Forums

[resolved] query_posts pagination problem (2 posts)

  1. dtirer
    Member
    Posted 8 months ago #

    So I have a custom template that display posts from a particular category (depending on the get_post_meta('Category')).

    The page works flawlessly for displaying posts from a 'News' Category. However, using the exact same code (minus how its displayed), it has problems with the Pagination for posts from the Calendar Category. Basically, the first page of posts display correctly, and then when you hit 'next page', the url updates to page/2, but the same posts are on the page.

    Here's my code: http://pastebin.com/Zr7TsyNs

  2. dtirer
    Member
    Posted 8 months ago #

    i figured it out. Because News is set to my front page, I need to use:

    <?php $paged = (get_query_var('page')) ? get_query_var('page') : 1; ?>

    And the Calendar page (or any other) uses:

    <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; ?>

    subtle difference :)

Reply

You must log in to post.

About this Topic