WordPress: Older posts, newer posts
Posted on November 18th, 2009 by Sacha Chua
I always get confused by “Previous page” and “Next page” on WordPress blogs. After only a little struggling, I finally got my navigation sorted out so that you can page through it using “Older posts” and “Newer posts”.
I added the following to my style.css:
.navigation { font-weight: bold; font-size: larger }
.navigation .right { float: right }
.navigation .left { float: left }
Then I added this to my theme’s index.php:
<div class="navigation">
<div class="left">
<?php next_posts_link('« Older posts'); ?>
</div><div class="right">
<?php previous_posts_link('Newer posts »'); ?>
</div>
</div>
Result: yay!
Short URL: http://sachachua.com/blog/p/6833




Oh yeah, on every wordpress installation this is a must. I still don’t get why they keep it like this. And it’s also the “next post” vs “previous post” (for those using it, where “next post” IS THE OLDER POST :)
Thanks for the useful tip and for your inspiring blog! Keep up the good work.
Best,
Aleksey
Thanks for the usability tip. I happened to be hacking my theme — I actually decided not to change it, using plugins instead — but since I already had the directory open, and the Filezilla fired up, I made the changes: “older” and “newer”.