Forums

[resolved] Page navigation problem with custom query (4 posts)

  1. scouture
    Member
    Posted 2 weeks ago #

    I'm having a problem flipping pages when I make a custom query with query_posts() or WP_Query(). The query get the right posts but navigating from page to page always returns the same posts.

    Any ideas?

    Thanks
    Seb

  2. MichaelH
    moderator
    Posted 2 weeks ago #

    Since you didn't supply any examples, will throw this out for your consideration:

    Example of proper pagination:

    <?php
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts('cat=1&posts_per_page='.get_option('posts_per_page').'&paged=' . $paged);
    ?>
  3. scouture
    Member
    Posted 2 weeks ago #

    MichaelH, you know everything.

    Thanks

    Seb

  4. MichaelH
    moderator
    Posted 2 weeks ago #

    Thanks, but I know just a few things.

Reply

You must log in to post.

About this Topic

Tags

No tags yet.