
By default, WordPress has functions to display links to previous and next pages. This is better than nothing, but I don’t understand why the folks at WordPress don’t build a pagenevi by default. But here is a plugin to display page numbers.
Configuration:
- First of all download Pagenavi WordPress Plugin.
- Unzip the archive and put the
wp-pagenavifolder into your plugins folder (/wp-content/plugins/). - Activate the plugin from the Plugins menu.
- Open the file that you want the pagination to be displayed in (e.g. index.php, categories.php, search.php, etc.), and find the following code:
<div>
<div><?php next_posts_link('Previous entries') ?></div>
<div><?php previous_posts_link('Next entries') ?></div>
</div>
Replace Code With.
<?php
include('wp-pagenavi.php');
if(function_exists('wp_pagenavi')) { wp_pagenavi(); }
?>
Save all pages. Refresh page.
