How to Add PageNavi to Twenty Eleven WordPress Theme ?

advertisement

wordpress is no doubt-a fast growing plate farm for webhosting.Many of us use this to make stylish dynamic websites.In my previous posts i have explained well about twenty eleven wordpress theme features,like to add modify sidebar,to make a change in fonts and also some usefull plugins.

In today’s post i will explain to add pagenavi to your blog/website,this will not only increase the look of your blog but also give an ease to its valuable readers.

 

Read Also:

How to Add PageNavi to Twenty Eleven WordPress Theme:

First of all download Wp-PageNavi Plugin and activate it
Go to admin > Appearance   > Editor > Function.php file
Find the following code

function twentyeleven_content_nav( $nav_id ) {
    global $wp_query;

    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">&larr;</span> Older posts', 'twentyeleven' ) ); ?></div>
            <div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) ); ?></div>
        </nav><!-- #nav-above -->
    <?php endif;
}

Replace it with this code

function twentyeleven_content_nav( $nav_id ) {
global $wp_query;

if ( $wp_query->max_num_pages > 1 ) : ?>
<nav id="<?php echo $nav_id; ?>">
<h3 class="assistive-text"><?php _e( 'Post navigation', 'twentyeleven' ); ?></h3>
<br>
<?php wp_pagenavi(); ?>
</nav><!-- #nav-above -->
<?php endif;
}

That’s all the plugin will work perfectly,you can see its action at the bottom of your post.

If you want to make it stylish then click installed plugin > Edit wp-pagnavi plugin > find the css file,make changes and enjoy.

You can observe the page navi of my page here.

2 Comments

  1. wycena nieruchomości kraków says:

    Nice blog right here! Additionally your website quite a bit up very fast!

    What host are you the use of? Can I get your associate hyperlink to your host?
    I desire my website loaded up as fast as yours lol

    • Rafaqat says:

      Thanks there are many things that can boost up page loading time,i think you should go through the article for further assistance http://www.technotrait.com/2012/07/11/top-5-ways-to-reduce-blog-loading-time

Leave a Reply