WordPress.org

Ready to get started?Download WordPress

Forums

Total pages error (10 posts)

  1. poco06
    Member
    Posted 1 year ago #

    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

  2. Krishna
    Volunteer Moderator
    Posted 1 year ago #

    Site URL?

  3. poco06
    Member
    Posted 1 year ago #

  4. Krishna
    Volunteer Moderator
    Posted 1 year ago #

    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.

  5. poco06
    Member
    Posted 1 year ago #

    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

  6. Krishna
    Volunteer Moderator
    Posted 1 year ago #

    It looks OK.

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

  7. poco06
    Member
    Posted 1 year ago #

    OK Krishna,

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

  8. poco06
    Member
    Posted 1 year ago #

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

  9. keesiemeijer
    moderator
    Posted 1 year ago #

  10. poco06
    Member
    Posted 1 year ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.