WP-PageNavi Version 2.72 Not Showing Page 2 (19 posts)

  1. kennyk3
    Posted 5 years ago #

    Hey all,

    I have WP-PageNavi Version 2.72 installed on my blog at:


    When I click on page 2, it goes to the URL:


    But shows the same as if it had directed to the homepage.

    I'd like to know how to resolve this...

  2. Michael
    Part-Time Forum Moderator
    Posted 5 years ago #

    it is not the plugins fault - there is something missing in index.php (?) of your theme.

    your index.php may have two loops with custom queries.

    edit index.php and look for the second custom query to show the list of posts;

    check if it includes the 'paged' parameter.
    (if there is an 'offset' parameter, things are more complicated; and you may be better off to try to get help from the theme's author.)

    if not, check this:

    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts('cat=-24&paged=' . $paged);

    on how you may be able to add this parameter (the cat=24 will definitely look different in your code, but the principle should be the same)

    you could also paste the code of index.php into a http://wordpress.pastebin.com/ and post the link to it here.

  3. kennyk3
    Posted 5 years ago #


    Thanks for the help. I've pasted it into http://wordpress.pastebin.com/

    Here's the link:


    I don't see any 'paged' parameter. Where would I paste that in?

  4. Michael
    Part-Time Forum Moderator
    Posted 5 years ago #

    i think this is the line with your query:

    try and change it from this:

    <?php $recent = new WP_Query("showposts=10"); while($recent->have_posts()) : $recent->the_post();?>

    to this:

    <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    $recent = new WP_Query("showposts=10&paged=" . $paged); while($recent->have_posts()) : $recent->the_post();?>

    good luck ;-)

  5. kennyk3
    Posted 5 years ago #

    Worked great. Thanks so much!

  6. microely
    Posted 5 years ago #

    Greetings of Peace!

    I've got Pagi Navi installed, it appears fine, and when I click the next page the URL changes, but the content doesn't. Any idea why? I'd like to know how to resolve this one. Any valuable information means a lot to me. Cheers!

    I have posted my index.php, here's the link: http://wordpress.pastebin.com/7WMhAV5h

  7. bringonmixedreviews
    Posted 5 years ago #

    I have Pagi Navi installed as well and I'm having a similar issue as Kennyk3. I was hoping that alchymyth might be able to help me too.
    I have posted my index.php here

    Hope you can help!

  8. Michael
    Part-Time Forum Moderator
    Posted 5 years ago #

    your code already has the 'paged' paramter; so the reason must be somwehere else in your theme files.
    did you contact 'woo' about the problem?
    (imho, prev/next posts links should be coded and working in every published theme)
    a link might help to check the behaviour of your site.
    are your permainks working? what if you reset to default permalinks?

    your code has a 'normal' loop without custom query; so the above fix would not work.

    it could be that some widget or other code in the left sidebar is disturbing the query-string;
    try to add <?php wp_reset_query(); ?> before line 7 <?php if (have_posts()) : ?>

    check your permalinks settings as well.

  9. bringonmixedreviews
    Posted 5 years ago #

    Thanks for the help Alchy,
    I just realized I didn't include exactly what was happening. When I use my sites (www.bringonmixedreviews.com) search and look for let's say "guitar" and it comes back with results, Page Navi is fine for that first page of results, but when I attempt to click page 2 of the search results, it reverts to page 2 of the linear regular postings. really weird. I'm not sure what would help fix it. any ideas?
    Thanks in advance!

  10. jeffkee
    Posted 5 years ago #

    I tried this... however on the line:

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

    The $page var returns 0, whenever it's on page 2 or above, hence the page module doe snot work - even the previous_posts_link() function fails to load because it WP thinks it's on the default page, even when the URL is /page/2 or /page/3.... Any ideas?

  11. divyeshsanghani
    Posted 5 years ago #


    i configure my blog at http://guj.krutarth.com

    which is redirected at http://www.krutarth.com/Gujarati/

    Where i have find page navi. error as mantion below.

    when ever i open http://www.krutarth.com/Gujarati/ this link that time page navi is not working proper.

    becz when i click at page 2 that time by default they open http://www.krutarth.com/Gujarati/index.php/Index.php/page/2

    when i use default permenent link that time it's work normal but when i use http://domain.com/Blog/inde.php/%postname%

    that time it's not working proper.

    and i dont ready to use default per. link for my blog.

    plz find my index.php code at http://wordpress.pastebin.com/P0fBjYsr

    also find wp-pagenavi.php code at http://wordpress.pastebin.com/rdJV50Uc

    plz help me out from this problems.... as soon as possible.

    Thanks & Regards

  12. gabpaladino
    Posted 5 years ago #

    i have a problem to, on archive.. and there are no query_post on it.

    please see.

    <?php get_header(); ?>
    			<h1><?php single_cat_title(NULL); ?></h1>
    			<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    				<h3><a href="<?php the_permalink() ?>" title="<?php single_cat_title(NULL); echo " - "; the_title(); ?>"><?php the_title(); ?></a></h3>
    				<?php the_excerpt() ?>
    			<?php endwhile; endif; ?>
    			<?php wp_pagenavi(); ?>
    <?php get_footer(); ?>

    on page http://www.lucianonarede.com.br/teste/noticias/page/2/

  13. verticalimit
    Posted 5 years ago #


    The plugin was working fine on my blog for months.
    Since i did the last update, i can not go to any page after page 1: I get an error: "Page is missing".


    Thanks in advance for any help :)

  14. insideoneness
    Posted 5 years ago #


    I have the same problem and since I can't contact the theme author, I really hope someone on this forum can help me

    I have paste the code of index.php into http://wordpress.pastebin.com/3R3ix6wr

    please see it if you have some free time. Thanks in advance :)

  15. daevisioninc
    Posted 5 years ago #

    alchymyth thanks a lot ur solution worked perfect!

  16. ies22admin
    Posted 5 years ago #

    I faced the same problem, too. How to fix it? here is the index.php

    ?php if (is_archive()) $post_number = get_option('thesource_archivenum_posts');
    if (is_search()) $post_number = get_option('thesource_searchnum_posts');
    if (is_tag()) $post_number = get_option('thesource_tagnum_posts');
    if (is_category()) $post_number = get_option('thesource_catnum_posts');
    if (is_home()) $args=array(
    'category__not_in' => get_option('thesource_exlcats_recent'),
    ); ?>
    <?php get_header(); ?>

    <?php global $query_string;
    if (is_category()) query_posts($query_string . "&showposts=$post_number&paged=$paged&cat=$cat");
    elseif (is_home()) query_posts($args);
    else query_posts($query_string . "&showposts=$post_number&paged=$paged"); ?

  17. hockeyfreak
    Posted 4 years ago #

    Hey there,

    For those of you that still have problems with:
    "2nd page not showing, or the posts of the 2nd page are the same as on the first one"
    Here is my fix to this problem, as suggested by alchymyth:

    For your information: I'm Using WP v3.1.2, WP-PageNavi v2.74 and TwentyTen as my Theme.

    In my case it hasn't anything to do with the index.php
    Here it was the <?php wp_reset_query(); ?> that was missing in the loop.php
    I inserted that now at the top of the file at line 21, followed by the code:

    <?php /* Display navigation to next/previous pages when applicable */ ?>
    <?php if ( $wp_query->max_num_pages > 1 ) : ?>
        <div id="nav-above" class="pageNav">
            <?php if(function_exists('wp_pagenavi')) : wp_pagenavi(); else: ?>
                <p style="float:left">
                <?php next_posts_link(__('&laquo; Previous entries','mytheme')); ?>
                <p style="float:right">
                <?php previous_posts_link(__('Next entries &raquo;','mytheme')); ?>
            <?php endif; ?>
        </div><!-- #nav-above -->
    <?php endif; ?>

    Although I had wasted hours to find a solution for this, it works fine now for me. Thanks for all your help!!!

    Greetz, Alex

  18. ronthai
    Posted 4 years ago #

    I tried the option above, but no luck for me.
    All I get is page 1 of 1 1 and the 1 can not even be clicked.
    I promise you I have more then 1 page.
    PHP 5.2

  19. Michael
    Part-Time Forum Moderator
    Posted 4 years ago #

    without seeing your site, it will be difficult to make any suggestions to fix your problem.

    link to your site?

Topic Closed

This topic has been closed to new replies.

About this Topic