WordPress.org

Ready to get started?Download WordPress

Forums

Pagination not working with custom loop (6 posts)

  1. jennifer2010
    Member
    Posted 2 years ago #

    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>
  2. esmi
    Forum Moderator
    Posted 2 years ago #

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

  3. jennifer2010
    Member
    Posted 2 years ago #

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

  4. esmi
    Forum Moderator
    Posted 2 years ago #

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

  5. jennifer2010
    Member
    Posted 2 years ago #

    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.

  6. esmi
    Forum Moderator
    Posted 2 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.