magnumcreative / magnum-bootstrap-pagination

Changes WP default pagination to Bootstrap 3 style
1 stars 1 forks source link

WP Bootstrap Pagination Plugin

This is a simple function that replaces the default WP style pagination with Bootstrap 3 pagination styling in your theme templates. The below instrutions are reflecting the use of Roots.io Starter theme. You may have to adjust things slightly differently in your theme.

Requirements

Instructions

Theme changes

Replace any instance of pagination found in your WP templates with the function page_navi();.

<?php if ($wp_query->max_num_pages > 1) : ?>
  <nav class="post-nav">
    <ul class="pager">
      <li class="previous"><?php next_posts_link(__('&larr; Older posts', 'roots')); ?></li>
      <li class="next"><?php previous_posts_link(__('Newer posts &rarr;', 'roots')); ?></li>
    </ul>
  </nav>
<?php endif; ?>

With the below

<?php if ($wp_query->max_num_pages > 1) : ?>
  <?php page_navi(); ?>
<?php endif; ?>