Are you looking to add fancy pagination links in WordPress? We can set numeric pagination for our blog. In this article, we show you how to add fancy pagination links in WordPress.
On our site, we are using the numeric pagination links as shown in the screenshot below.
Why Need Fancy Pagination Links?
When we install the WordPress, default themes shows Older posts and Newer posts links. Most of the WordPress themes also shows the same kind of links. Some premium themes use numeric pagination for the site. Numeric pagination links are looks better and user-friendly compare to traditional links.
WordPress has a plugin called ‘WP-Pagenavi’ in their repositories. Using this plugin, we can add fancy pagination links in WordPress.
Add Fancy Pagination Links In WordPress Using WP-Pagenavi
Head over to repository, download the plugin and install it.
Once you activated the plugin, go to Settings->PageNavi page. On this setting page, You can configure all options. You can also keep default configurations as it is. Default configurations also work well.
Next, find the methods next_posts_link() and previous_posts_link() from the active theme directory. Replace above methods by the single line below.
<?php wp_pagenavi(); ?>
Add Styling To Your Pagination Links
Pagination links generated using this plugin use the style from pagenavi-css.css file. This CSS file located in the root directory of a plugin. Default styling of pagination links is quite good. But still, if you want to apply different style for pagination links, then copy this CSS file in your theme directory and add your own styling. By this way, your changes will not override after updating the plugin.
Another way is set the ‘Use pagenavi.css’ option to ‘No’ on the plugin’s setting page. And then add your styling in theme’s ‘style.css’ file.
We hope you understand how to add fancy pagination links in WordPress. You may also want to read our related articles on How To Create Custom Login Form In WordPress.
If you liked this article, then please subscribe to our YouTube Channel for video tutorials.