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.
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.