Support » Fixing WordPress » Total pages error

  • Hello,
    I have an issue with the total pages in my blog. I have 19 articles and the total pages is 19 (and I have set the number of posts per page to 5, so normally, total pages should be 5 max!).
    I tried pagenavi and pagebar plugins but got the same error each time!
    Is there anything to do to change that?
    Many thanks

Viewing 9 replies - 1 through 9 (of 9 total)
  • Site URL?

    Looks like a problem created by your theme (or a plugin, possibly). Can you revert to Twenty Eleven theme and see if the problem still persists? You can put back your theme afterwards.

    Hi Krishna,

    I have replaced Gantry theme by Twenty Eleven and it’s working fine. In order to make pagebar working, I modified the file : wp-content/themes/rt_gantry_wp/html/home.php as follow :

    Initial value :

    [ Moderator Note: Please post code or markup snippets between backticks or use the code button. ]

    <!-- Begin Navigation -->
    
    				<?php if($custom_query->max_num_pages > 1) : ?>
    
    				<div class="rt-pagination nav">
    					<div class="alignleft">
    						<?php next_posts_link('« '._r('Older Entries'), $custom_query->max_num_pages); ?>
    					</div>
    					<div class="alignright">
    						<?php previous_posts_link(_r('Newer Entries').' »', $custom_query->max_num_pages) ?>
    					</div>
    					<div class="clear"></div>
    				</div>
    
    				<?php endif; ?>
    
    				<!-- End Navigation -->

    Modified by :

    <!-- Begin Navigation partie modifiée pour intégrer pagenavi -->
    
    				<?php if($custom_query->max_num_pages > 1) : ?>
    
    				<div class="rt-pagination nav">
    					<?php pagebar(); ?>
    					<div class="clear"></div>
    				</div>
    
    				<?php endif; ?>
    
    				<!-- End Navigation -->

    Regards

    It looks OK.

    While posting code, please use the code button or use backticks.

    OK Krishna,

    Unfortunately, this is not solving my issue as when I switch to Gantry again, the same problem is coming back.
    Regards

    Hello,
    Is there a way to find where the max_pages variable is defined?
    Many thanks

    Moderator keesiemeijer

    (@keesiemeijer)

    moderator

    Hello,
    I have no issue with redirected links. In fact, it seems that the “total_pages” is equal to “total_posts” in my case. If I set the number of post per page to 1, then, pagebar is working correctly!
    Regards

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Total pages error’ is closed to new replies.