• Resolved aknee00

    (@aknee00)


    I am using wordpress Focus theme and I replaced default navigation links with WP-PageNavi navigation.

    But there is a problem…
    In first and last page navigation shows ok:
    http://postimg.org/image/tlrbm4tzn/ (screenshot)
    But in other pages shows like this:
    http://postimg.org/image/keb7xildt/ (screenshot)

    Default navigation code:

    <?php elseif ( $wp_query->max_num_pages > 1 && ( is_home() || is_archive() || is_search() ) ) : // navigation links for home, archive, and search pages ?>
    
    		<?php if ( get_next_posts_link() ) : ?>
    		<div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">&larr;</span> Older posts', 'focus' ) ); ?></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>', 'focus' ) ); ?></div>
    		<?php endif; ?>
    
    	<?php endif; ?>

    And code after PageNavi instructions:

    <?php elseif ( $wp_query->max_num_pages > 1 && ( is_home() || is_archive() || is_search() ) ) : // navigation links for home, archive, and search pages ?>
    
    		<?php if ( get_next_posts_link() ) : ?>
    		<?php wp_pagenavi(); ?>
    		<?php endif; ?>
    
    		<?php if ( get_previous_posts_link() ) : ?>
    		<?php wp_pagenavi(); ?>
    		<?php endif; ?>
    
    	<?php endif; ?>

    What I need to change in code? Please help!

    https://wordpress.org/plugins/wp-pagenavi/

Viewing 4 replies - 1 through 4 (of 4 total)
  • try to remove the inner conditional statements; example:

    <?php elseif ( $wp_query->max_num_pages > 1 && ( is_home() || is_archive() || is_search() ) ) : // navigation links for home, archive, and search pages ?>
    
    		<?php wp_pagenavi(); ?>
    
    	<?php endif; ?>
    Thread Starter aknee00

    (@aknee00)

    alchymyth, but it doesn’t work… :/

    please post more details about ‘it doesn’t work’ :
    – do you get any error messages?
    – pagenavi not shown at all?
    – pagenavi still shown double?
    – what exactly is the result?

    Thread Starter aknee00

    (@aknee00)

    Sorry! My fault… deleted wrong tags!
    Now navigation works! Thank You!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Showing double navigation’ is closed to new replies.