Support » Fixing WordPress » Pagination not working with custom loop

  • I’m using a custom loop to display posts from a specific category. The “Older Entries” link results in showing the same posts on the second page as the ones on the first.

    Here’s the custom loop code:

    <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts("post_type=post&paged=$paged"); ?>
    <?php query_posts('cat=1&showposts='.get_option('posts_per_page')); ?>
    <?php if (have_posts()) : $count = 0; ?>
    <?php while (have_posts()) : the_post(); $count++; ?>
    <?php if (function_exists('wp_pagenavi')) wp_pagenavi(); else { ?>
    <div class="fl"><?php next_posts_link(__('« Older Entries', 'woothemes')) ?></div>
    <div class="fr"><?php previous_posts_link(__('Newer Entries »', 'woothemes')) ?></div>
    <br class="fix" />
    <?php } ?>
    </div>
    </div>

Viewing 5 replies - 1 through 5 (of 5 total)
  • esmi

    (@esmi)

    Forum Moderator

    I’m sorry but as you are using a commercial theme, you need to seek support from the theme’s vendors.

    @esmi it’s a free theme and wordpress pagination has nothing to do with theme support.

    esmi

    (@esmi)

    Forum Moderator

    It is not our place to keep theme vendors in business or deprive them of any income that they may derive from support services.

    Once again, this has nothing to do with the theme. There’s a problem with the pagination. If I used the same custom loop in Twenty Eleven it would still not work.

    esmi

    (@esmi)

    Forum Moderator

    Well you could try using query_posts('post_type=post&paged=' .$paged)

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Pagination not working with custom loop’ is closed to new replies.