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 comment with Disqus or you can e-mail me at sacha@sachachua.com.