Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I think the way wordpress display previous and next posts is basically non sense, with next posts on the left side, and older posts on the right side.

I am using the code

<?php posts_nav_link() ?>

is there a way to reverse such order?

share|improve this question
add comment

3 Answers

up vote 2 down vote accepted

This is because it is, by default, done as 'previous page' on the left, and 'next page' on the right. Posts appear in reverse chronological order, with the latest post first, so 'next page' means going back in time. So in terms of pages it makes sense, in terms of chronology it doesn't.

Anyway... this should work:

<div class="navigation">
   <div class="alignleft"><?php next_posts_link('&laquo; Older Entries','') ?></div>
   <div class="alignright"><?php previous_posts_link('Newer Entries &raquo;') ?></div>
</div>
share|improve this answer
add comment

Take a look at this

http://codex.wordpress.org/Function_Reference/posts_nav_link

Note: since weblog posts are traditionally listed in reverse chronological order (with most recent posts at the top), there is some ambiguity in the definition of "next page". WordPress defines "next page" as the "next page toward the past". In WordPress 1.5, the default Kubrick theme addresses this ambiguity by labeling the "next page" link as "previous entries". See Example: Kubrick Theme Format.

You can use next_posts_link() and previous_posts_link() separately and place where ever you want in your template.....

share|improve this answer
add comment

The function...

posts_nav_link( $separator, $prev_label, $next_label );

...calls...

get_posts_nav_link()

...where the defaults for the previous function come from. If then the query_var

$query->max_num_pages // must be greater than one to trigger

...is set, the functions...

get_previous_posts_link()
get_next_posts_link()

get called. If then...

$query->paged // must be set lower than 2 
$query->max_num_pages // or equal to $paged

...meets, the function will add a separator between both links.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.