KLoning Spoon

First create a functions.php for your child theme and add

// Show Wp-PageNavi when it's active function twentyeleven_child_content_nav( $nav_id ) { global $wp_query; if ( $wp_query->max_num_pages > 1 ) : ?> <?php /* add wp-pagenavi support for posts */ ?> <?php if(function_exists('wp_pagenavi') ) : ?> <?php wp_pagenavi(); ?> <br /> <?php else: ?> <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; ?> <?php endif; }

Next copy index.php to your child theme folder and change line 31 to
<?php twentyeleven_child_content_nav( 'nav-below' ); ?>

If wp-pagenavi is installed it will show it, if it isn’t, it’ll show the default next/previous

Blog comments powered by Disqus