WordPress.org

Ready to get started?Download WordPress

Forums

WP-PageNavi
wp-pagenavi won't go past first page. (5 posts)

  1. chris@route66marathon.com
    Member
    Posted 3 years ago #

    I have seen other similar posts with different solutions that work for this problem. Can someone please help me figure out why the first page of posts displays but when a user clicks page-2 or greater the first page is all that displays?

    The website is route66marathon.com

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

    it is most likely not caused by the plugin, but by some custom query in the template of your home page (index.php ?) which is not using the 'paged' parameter:

    http://codex.wordpress.org/Function_Reference/WP_Query#Pagination_Parameters

    if you have trouble location the code, you could paste the full code of the front page template (index.php ?) into a http://pastebin.com/ and post the link to it here.

  3. chris@route66marathon.com
    Member
    Posted 3 years ago #

    Thank you for your assistance. I am sorry that I could not get it to work. I am new to php. I have created a pastebin at the link below.

    http://pastebin.com/ea9cF2du

    Any assistance you can provide will be greatly appreciated.

  4. alchymyth
    The Sweeper & Moderator
    Posted 3 years ago #

    locate this section:

    <?php if (1){
          query_posts('cat=5');
    }
     ?>

    two possibilities:
    a:
    change it to:

    <?php if (1){
    global $query_string;
          query_posts($query_string . '&cat=5');
    }
     ?>

    http://codex.wordpress.org/Function_Reference/query_posts#Usage_Note

    or b:
    change it to:

    <?php if (1){
    $paged = get_query_var('paged');
          query_posts('cat=5&paged=' . $paged);
    }
     ?>

    http://codex.wordpress.org/Function_Reference/WP_Query#Pagination_Parameters

  5. chris@route66marathon.com
    Member
    Posted 3 years ago #

    Option A worked! Just so you know I also tried option B which did not work. Thank you so much for your help!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic