• After hours of searching and trying out I managed to find a solution so thought I should post it here so that it may help others.

    The problem

    The numbered pages were showing up fine but when you clicked on a number to get to a particular page only the URL changed but the page content stayed the same.

    The Solution

    After much trial & error it seemed that it was a problem with query_posts()function as plugin cannot determine which page the user is on, and so it defaults to the first page every time the page loads.

    I found this fantastic write up of exactly what the problem was and how to fix it in a blog by web designer Philip Beel.

    If you have the same or similar problem I recommend you read his blog article as it helped me fix the problem and hopefully will help you.

    Click here to go to article.

    https://www.ads-software.com/extend/plugins/wp-pagenavi/

Viewing 9 replies - 1 through 9 (of 9 total)
  • It is not the plugin, even if you are using the default navigation, with fixed query_posts() without $paged or $query_string, it will not work.

    Hi Lester I’m stuck on this same issue.
    I know you’ve got a proper job now and have announced that you’ve stopped supporting all your plugins. However you’ve answered this post and I’m not in two mind on what I should be doing.

    Are you stating that the fix duckonwater is using is wrong?
    If it is wrong can you give me a hint as to the fix.

    I’ve spotted you referring to the same code that needs changing on numerous blogs in my search for an answer to this problem however you never say what file it should be placed in?

    Here is the code from my index.php which I believe might be causing an issue:

    [Moderated] Code removed as per forum rules

    It should be placed in whichever file uses query_posts().

    Read this: Paging and Custom WordPress Loops

    Thanks scribu.
    However my site uses pretty permalinks.

    Having looked at the responses in the comments box on the link you provided it doesn’t work with pretty links.

    I’m confused as to why this plugin has worked for me in the past without having to customise code.
    Still stuck.

    Anyone else

    Having looked at the responses in the comments box on the link you provided it doesn’t work with pretty links.

    Replace $paged with get_query_var('paged') and it should work with pretty permalinks too.

    I’m confused as to why this plugin has worked for me in the past without having to customise code.

    As Lester mentioned, this has nothing to do with the plugin, but with your theme’s code: The plugin just sends you to a URL, but it’s the theme’s responsibility to show the right posts.

    Thanks Scribu, I’ve actually posted on Lesters Forum with the code. I don’t seem to be able to find the line “get_query_var”

    Please can you take a look at it for me here:
    https://forums.lesterchan.net/index.php?topic=4654.0

    Mucho Thanks

    Adam

    This line is useless; remove it:

    <?php query_posts('showposts='.get_option('posts_per_page')); ?>

    If it turns out that you need it, replace it with this:

    <?php query_posts(array(
       'showposts' => get_option('posts_per_page'),
       'paged' => get_query_var('paged')
    )); ?>
    Thread Starter Duncan Michael-MacGregor

    (@duckonwater)

    I can confirm that it is not the plugin causing issue but theme code.

    Thanks for such a great plugin GamerZ, your easily in the top 5 plugin developers out there, keep up the fantastic work! ??

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Plugin: WP-PageNavi] Plugin cannot determine which page the user is on’ is closed to new replies.