• Hi,

    I replaced default navigation links with WP-PageNavi navigation.

    Default code

    <?php if ( get_next_posts_link() ) : ?>
    			<div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'tesseract' ) ); ?></div>
    			<?php endif; ?>
    
    			<?php if ( get_previous_posts_link() ) : ?>
    			<div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</span>', 'tesseract' ) ); ?></div>
    			<?php endif; ?>

    Replaced it with

    <?php if ( get_next_posts_link() ) : ?>
    			<?php wp_pagenavi(); ?>
    			<?php endif; ?>
    
    			<?php if ( get_previous_posts_link() ) : ?>
    			<?php wp_pagenavi(); ?>
    			<?php endif; ?>

    But one page 2+ I get double navigation. One the last page and the first page it’s fine. What do I have to change in the code?

    Thanks.

  • The topic ‘WP-PageNavi double navigation’ is closed to new replies.