Support » Fixing WordPress » chronological posts stuck on page 1

  • I have a category set up which I want to display chronologically. To accomplish this, I created a category-5.php, which is identical to index.php, except it has:


    at the top. Works like a charm. Except for when I use the navigation links at the bottom:

    <div class="alignleft"><?php posts_nav_link('','&laquo; Previous Entries','') ?></div>
    <div class="alignright"><?php posts_nav_link('','','Next Entries &raquo;') ?></div>

    and arrive at a URL like:

    it is still the first three posts (not the next three, as I was expecting). Somewhat of a newbie, but I can write PHP and I thought I understood the way the loop worked. How do I get the paging to word correctly with ASC? Help, please!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Seems like there’s an ambiguity (see Template_Tags/posts_nav_link) when you are sorting post in ascending (oldest first) order.

    I can’t swear to it, but maybe the Custom Query String plugin might solve your problem.

    Ok, I’ve installed and activated the custom query string plugin, but that didn’t seem to help; is there something more I need to configure?

    Moderator Samuel Wood (Otto)

    (@otto42) Admin

    Change your query_posts call to this:

    query_posts($query_string . '&order=ASC');

    Done and done. No need for any weird plugins.

    There’s no ambiguity involved here. You’re just failing to pass the query_string into the query_posts call. Without that, there’s no way for query_posts to know that you want page 2 of the posts, for example.

    Thanks, Otto42… works like a charm!

    yay! thanks Otto42.
    I’ve read in other threads that query_posts will break paging.
    It did in my blog, but then I added query_string and it fixed! =D

    <?php query_posts($query_string . ‘&cat=10&showposts=5’); ?>

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘chronological posts stuck on page 1’ is closed to new replies.