How to rethink the default WordPress next-previous links

One of the toughest things to do is question standards. When something works a certain way, all the time, it’s difficult to question whether it is working the way it should be. When something is, it’s hard to ask if it should be.

In this case, I’d like to question the behavior of the next/previous post archive links that WordPress sites tend to use. Step back for a second, and consider whether this really makes sense:

The way most WordPress sites display post navigation.

In this tutorial we’re going to make these links a little more human.

Let’s step back and think about how these links should operate. We reach the bottom of the list of posts, and now have two options: view older posts or more recent posts.

So let’s use the words “older” and “newer”. This is the modified PHP that we’ll use:

<?php posts_nav_link('','Newer Posts','Older Posts'); ?>

This would change our example above to look like this:

CSS will effect how your links look, of course. If you would like an easier way to control your post navigation, as well as pagination, check out the WP-PageNavi Plugin.

The new default WordPress theme, Twenty Ten, serves up these links in this more human way, which is great. But there are plenty of bad examples out there. Forget “previous.” Think “older.” Forget “next. “Think “newer” or “more recent.”

A conceptual tutorial

This was more of a conceptual tutorial than anything else. Changing our thinking is just as important as learning to sling code, and arguably harder.

Have you ever considered this problem before? Are there any other WordPress defaults that are worth reconsidering?

Leave a Reply

Your email address will not be published. Required fields are marked *