Daily archives: Thursday, January 21, 2010
I had the occasion yesterday to have a page with a section on it where it would output a very specific set of other pages, which would need to change dynamically. What I could have done is built a special page template for this page, and inside that template run a
query_posts() to get these posts. But I wanted this page to remain editable from the admin. Besides, creating a special page template every time you need to do something like this is too cumbersome. WordPress is extensible enough to do better.
Jack Osborne emailed me with a question. His blog layout shows single posts at a time, with a set of arrows to navigate forward and backward in time. This works great on the single.php page where you can use
prev_post_link(), but those don't work on the index.php file.
Jack wrote up the solution I sent him.