Strange Pagination Issues

We are starting to paginate some of our posts, such as this one: http://www.encapo.com/top/15-organizing-products-on-amazon-that-people-actually-swear-by and it looks great, except for some reason on the very last page it is showing three arrows instead of just two: http://www.encapo.com/top/15-organizing-products-on-amazon-that-people-actually-swear-by/5/

Can you tell me how to remove the arrow on the top so there is just an arrow like this "<" next to the arrow button like this ">"?

I have granted wpmu support access , in case that helps.

Thanks for your help!

  • Predrag Dubajic

    Hey d-invent,

    Hope you're doing well today :slight_smile:

    Looks like the last page is adding additional pagination that should be showing only on that page but it doesn't hide the other one for some reason.

    I'm not familiar with Genesis child theme you're using or what in the theme could be causing that but we can hide the unwanted one with a simple CSS snippet like this:

    .last-pager .entry-pagination {
        display: none;
    }

    If your theme doesn't have custom CSS field, then you may wish to use a child theme or a plugin like this one for this additional CSS. That way you're protected when you come to upgrade.

    Best regards,
    Predrag

  • d-invent

    In case it is helpful, I believe this is the code that handles the pagination on the last page:

    function last_page_cta() {
    	if ( is_single() ) {
    global $multipage, $numpages, $page;
    if( $multipage && $page == $numpages ) {
    remove_action( 'genesis_entry_content', 'genesis_do_post_content_nav_new', 15 );
    remove_action('genesis_post_content','genesis_do_post_content_nav_new', 15);
    ?>
    <div class="last-pager">
    <?php
    	wp_link_pages( array(
    		'before' => genesis_markup( array(
    				'html5'   => '<div %s>',
    				'xhtml'   => '<p class="pages end-page">',
    				'context' => 'entry-pagination',
    				'echo'    => false,
    			) ) . __( '', 'genesis' ),
    		'next_or_number'   => 'next',
    		'separator'        => ' ',
    		'nextpagelink'     => __( '<i class="fa fa-chevron-right"></i>' ),
    		'previouspagelink' => __( '<i class="fa fa-chevron-left"></i>' ),
    		'pagelink'         => '%',
    		'after'  => genesis_html5() ? '' : '</p>',
    	) );
    
        echo '<a href="http://www.recaplet.com"><i class="fa fa-chevron-right"></i></a></div>';
    ?>
    </div>
    <?php
    }
    	}
    }
    add_action( 'genesis_entry_content', 'last_page_cta', 12 );
    add_action( 'genesis_post_content', 'last_page_cta' );
  • Adam Czajczyk

    Hello d-invent!

    You're right about that this is the code to handle "last page" pagination. However, that is the code that creates these two buttons that you actually want to keep there so that'd be a "no go", I think :slight_smile:

    We do not know however what code is responsible for that other button in your theme and while there's no "specific" CSS selector that could indicate that it's the last page, that makes CSS approach a bit difficult. I think that knowing what code is adding that button could let us hook to it so if you can see any other code in your child theme that's adding pagination, let me know please.

    If there's an "Editor" option available under "Appearance" menu of your site's dashboard, that can also help and I may be able to check it myself so you could grant me a support access to let me take a look:

    https://premium.wpmudev.org/manuals/wpmu-dev-dashboard-enabling-staff-login/

    Best regards,
    Adam

  • d-invent

    Sure, support access has been enabled!

    In case it helps, this is the only other code in functions.php that deals with navigation. So I suspect this is what we are looking for...

    add_action( 'genesis_entry_content', 'genesis_do_post_content_nav_new', 12 );
    add_action('genesis_post_content','genesis_do_post_content_nav_new');
    
    function genesis_do_post_content_nav_new() {
    
    	wp_link_pages( array(
    		'before' => genesis_markup( array(
    				'html5'   => '<div %s>',
    				'xhtml'   => '<p class="pages">',
    				'context' => 'entry-pagination',
    				'echo'    => false,
    			) ) . __( '', 'genesis' ),
    		'next_or_number'   => 'next',
    		'separator'        => ' ',
    		'nextpagelink'     => __( '<span class="pagination-before">NEXT PAGE <i class="fa fa-chevron-right"></i></span><span class="pagination-after"><i class="fa fa-chevron-right"></i></span>' ),
    		'previouspagelink' => __( '<i class="fa fa-chevron-left"></i>' ),
    		'pagelink'         => '%',
    		'after'  => genesis_html5() ? '</div>' : '</p>',
    	) );
    
    }
    remove_action( 'genesis_entry_content', 'genesis_do_post_content_nav', 12);
    remove_action( 'genesis_post_content', 'genesis_do_post_content_nav' );

    Thanks for your help!

  • Dimitris

    Hey there d-invent,

    hope you're doing good and don't mind me chiming in here! :slight_smile:

    I just inspected these pages you shared with us, could you please try to use the following CSS code in Divi's custom CSS area?

    .last-pager {
      display: none;
    }

    Let me know how that goes!

    If more assistance is required, please re-grant us with support access as it seems that expired (it does that automatically for security reasons).
    https://premium.wpmudev.org/docs/getting-started/getting-support/#chapter-4

    Warm regards,
    Dimitris

  • d-invent

    That has the same result as the first person who replied from WPMU, which is that it removes two buttons, so there is just a button to the previous page. I want two buttons to appear... one that goes to the previous page and one that goes to the homepage. I just want the 3rd button (the one above the other two) to not appear...

    I have granted wpmu support access, and do believe the issue resides within functions.php

    Here are the code snippets that I believe handle the navigation:

    add_action( 'genesis_entry_content', 'genesis_do_post_content_nav_new', 12 );
    add_action('genesis_post_content','genesis_do_post_content_nav_new');
    
    function genesis_do_post_content_nav_new() {
    
    	wp_link_pages( array(
    		'before' => genesis_markup( array(
    				'html5'   => '<div %s>',
    				'xhtml'   => '<p class="pages">',
    				'context' => 'entry-pagination',
    				'echo'    => false,
    			) ) . __( '', 'genesis' ),
    		'next_or_number'   => 'next',
    		'separator'        => ' ',
    		'nextpagelink'     => __( '<span class="pagination-before">NEXT PAGE <i class="fa fa-chevron-right"></i></span><span class="pagination-after"><i class="fa fa-chevron-right"></i></span>' ),
    		'previouspagelink' => __( '<i class="fa fa-chevron-left"></i>' ),
    		'pagelink'         => '%',
    		'after'  => genesis_html5() ? '</div>' : '</p>',
    	) );
    
    }
    remove_action( 'genesis_entry_content', 'genesis_do_post_content_nav', 12);
    remove_action( 'genesis_post_content', 'genesis_do_post_content_nav' );

    and this portion as well:

    function last_page_cta() {
    	if ( is_single() ) {
    global $multipage, $numpages, $page;
    if( $multipage && $page == $numpages ) {
    remove_action( 'genesis_entry_content', 'genesis_do_post_content_nav_new', 15 );
    remove_action('genesis_post_content','genesis_do_post_content_nav_new', 15);
    ?>
    <div class="last-pager">
    <?php
    	wp_link_pages( array(
    		'before' => genesis_markup( array(
    				'html5'   => '<div %s>',
    				'xhtml'   => '<p class="pages end-page">',
    				'context' => 'entry-pagination',
    				'echo'    => false,
    			) ) . __( '', 'genesis' ),
    		'next_or_number'   => 'next',
    		'separator'        => ' ',
    		'nextpagelink'     => __( '<i class="fa fa-chevron-right"></i>' ),
    		'previouspagelink' => __( '<i class="fa fa-chevron-left"></i>' ),
    		'pagelink'         => '%',
    		'after'  => genesis_html5() ? '' : '</p>',
    	) );
    
        echo '<a href="http://www.recaplet.com"><i class="fa fa-chevron-right"></i></a></div>';
    ?>
    </div>
    <?php
    }
    	}
    }
    add_action( 'genesis_entry_content', 'last_page_cta', 12 );
    add_action( 'genesis_post_content', 'last_page_cta' );

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.