WordPress.org

Ready to get started?Download WordPress

Forums

Pagination not working on modified loop (2 posts)

  1. jeezyo
    Member
    Posted 2 years ago #

    Hi...i modified the following blog page template (home is a static page) so that it would only pull posts from the "blog" category. im noticing now however, that though the pagination displays correcty, if i click on page 2, it just refreshed the same page of posts, and i cant get to the older posts. wondering if somebody can take a look and guide me on how i might modify this so it works properly with my category modification, since im not sure whats wrong. thanks! http://pastebin.com/4VmJhCNs

  2. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    try to re-organize this section:

    query_posts("paged=$paged");
                    ?>
                <?php if (have_posts()) : $count = 0; ?>
                <?php query_posts( 'category_name=blog' ); ?>

    to something like:

    query_posts("category_name=blog&paged=$paged");
                    ?>
                <?php if (have_posts()) : $count = 0; ?>

    i.e. add the category parameter to the existing query.

Topic Closed

This topic has been closed to new replies.

About this Topic