Support » Plugin: WP-PageNavi » [Plugin: WP-PageNavi] Remove pagenavi from the top of the page

Viewing 2 replies - 1 through 2 (of 2 total)
  • bump

    Had the same problem . Might not be the best way, but I solved it by adding another if statement to functions.php to check if it’s the bottom nav. If not, it doesn’t do anything.

    Original functions.php (pre PageNavi edits):

    if ( $wp_query->max_num_pages > 1 ) : ?>
                    <nav id="<?php echo $nav_id; ?>">
                            <h3 class="assistive-text"><?php _e( 'Post navigation', 'twentyeleven' ); ?></h3>
                            <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">←</span> Older posts', 'twentyeleven' ) ); ?></div>
                            <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">→</span>', 'twentyeleven' ) ); ?></div>
                    </nav><!-- #nav-above -->
            <?php endif;

    With PageNavi changes and code to not output top navi panel:

    if ( $wp_query->max_num_pages > 1 ) : ?>
                    <nav id="<?php echo $nav_id; ?>">
                    <strong><?php if ($nav_id == "nav-below"):?></strong>
                            <h3 class="assistive-text"><?php _e( 'Post navigation', 'twentyeleven' ); ?></h3>
                            <!-- <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">←</span> Older posts', 'twentyeleven' ) ); ?></div>
                            <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">→</span>', 'twentyeleven' ) ); ?></div> -->
                            <strong><?php wp_pagenavi(); ?></strong>
                    <strong><?php endif; ?></strong>
                    </nav><!-- #nav-above -->
            <?php endif;

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: WP-PageNavi] Remove pagenavi from the top of the page’ is closed to new replies.