How to show next/prev pagination/navigation without Plugins

Wp Pagination

Show next previous button to show next page’s  and previous page’s list, Add pagination without plugins, simply paste given code on your active theme.

How to Show Next Previous Button

  • Open file manager or active theme‘s folder.
  • Open functions.php file and paste given code then SAVE.
function thekroyaard_pagination() {
global $wp_query;
echo '<div class="pagination" role="navigation">';
echo '<div class="nav-next" style="float: left; left: 0;">';
/** Previous Post Link */
if ( get_previous_posts_link() )
previous_posts_link( '&larr;' );
echo '</div>';
echo '<div class="nav-previous" style="float:right; right: 0;">';
/** Next Post Link */
if ( get_next_posts_link() )
next_posts_link( '&rarr;' );
echo '</div>';
echo '</div>';
}
  • Then paste thekroyaard_pagination(); where you want to show Next Previous Button.

Hope this code worked on your WordPress Theme. Thank you for visiting thekroyaard.com.