WordPress.org

Ready to get started?Download WordPress

Forums

WP-PageNavi
Pagination works but "current" page is always 1 (3 posts)

  1. jnahan
    Member
    Posted 1 year ago #

    The pagination on my site correctly shows the first set of pages, then the group of larger numbers, just as I specified. And each of those page links works correctly. However, page 1 is always set as the current page and next is always linked to page 2.

    I've dug through lots of support responses and details. Following the instructions at http://scribu.net/wordpress/wp-pagenavi/right-way-to-use-query_posts.html I updated my query_posts to:
    query_posts(array('post_type'=>'page','post_parent'=>585,'orderby' => 'title', 'order' => 'ASC', 'paged' => get_query_var('paged') ) );

    wp_reset_query() is run right after that loop, as it should.

    But I still get page 1 as current and next as page 2, no matter what page I'm on.

    I have tested the value of get_query_var('paged') at various points in the code by printing it to a comment. The value is always 1.

    I've also tried using the get_query_var('page') variation and the result is the same.

    Any help would be most appreciated.

    http://wordpress.org/extend/plugins/wp-pagenavi/

  2. Davidsdesk
    Member
    Posted 1 year ago #

    I am running WP 3.5.1 and WP-PageNavi 2.83 and having the same problem as the post, above. Any advice would be very much appreciated.

    Thanks,

    David

  3. jsoloway
    Member
    Posted 8 months ago #

    Couple of things that may or may not help:

    1. Where is your reset put in the template? Is it after the loop, or is it after wp_pagenavi()?
    2. Have you tried using wp_reset_postdata()? instead of wp_reset_query()?

    My template is using the postdata reset after the call for pagenavi and is highlighting the correct page when navigating.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.