How to add pagination in wordpress

How to add pagination in wordpress

Many times adding the custom pagination in wordpress blog is very important. Adding custom pagination in wordpress blog is good. In this article, we will show you, How to add pagination in wordpress with plugin and without wp plugin

How to add pagination in wordpress

  • Simple WordPress Default pagination

You need to open the your index.php file from wordpress theme and put following code in that file.

<div class="navigation">
<div class="alignleft"><?php next_posts_link('Previous') ?></div>
</div>
<div class="alignright"><?php previous_posts_link('Next') ?></div>

If you want the pagination in single post then you can use the following code:

<?php next_posts_link($label , $max_pages); ?>
<?php prev_posts_link($label , $max_pages); ?>

More pagination style visit above URL: wordpress pagination style without wordpress plugin

There are some very nice wordpress plugin available for wordpress pagination.

How to add pagination in wordpress
How to add pagination in wordpress

PageNavi wordpress plugin is really nice. I personally like this plugin so much. With this plugin you can apply your custom css also.

  • Changing the CSS

If you need to configure the CSS style of WP-PageNavi, you can copy the pagenavi-css.css file from the plugin directory to your theme’s directory and make your modifications there. This way, you won’t lose your changes when you update the plugin.

Alternatively, you can uncheck the “Use pagenavi.css?” option from the settings page and add the styles to your theme’s style.css file directly.

Published by

Purab

I am Purab from India, Software development is my profession and teaching is my passion. Programmers blog dedicated to the JAVA, Python, PHP, DevOps and Opensource Frameworks. Purab's Github Repo Youtube Chanel Video Tutorials Connect to on LinkedIn

Leave a Reply

Your email address will not be published.