Skip to content

Instantly share code, notes, and snippets.

@jmsmrgn
Last active January 3, 2016 07:58
Show Gist options
  • Save jmsmrgn/8432483 to your computer and use it in GitHub Desktop.
Save jmsmrgn/8432483 to your computer and use it in GitHub Desktop.
Bootstrap styleable WP pager function
function bootstrap_wp_pager() {
echo '<ul class="pager">';
$next = get_next_posts_link( 'Older &rarr;');
$prev = get_previous_posts_link( 'Newer &larr;' );
if ( !empty($prev) )
echo '<li class="previous">'.$prev.'</li>';
if ( !empty($next) )
echo '<li class="next">'.$next.'</li>';
echo '</ul>';
}
// Call within theme with
<?php bootstrap_wp_pager(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment