WordPress: Older posts, newer posts

| geek, wordpress

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('&laquo; Older posts'); ?>
  </div><div class="right">
    <?php previous_posts_link('Newer posts &raquo;'); ?>
  </div>
</div>

Result: yay!

image

You can view 1 comment or e-mail me at sacha@sachachua.com.

1 comment

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".