Skip to content

Instantly share code, notes, and snippets.

@mattradford
Created April 8, 2015 16:04
Show Gist options
  • Save mattradford/dba3fa2bdd102f9c5b12 to your computer and use it in GitHub Desktop.
Save mattradford/dba3fa2bdd102f9c5b12 to your computer and use it in GitHub Desktop.
page navigation, from bones
<?php
// Numeric Page Navi (built into the theme by default)
function bones_page_navi() {
global $wp_query;
$bignum = 999999999;
if ( $wp_query->max_num_pages <= 1 )
return;
echo '<div class="pagination">';
echo paginate_links( array(
'base' => str_replace( $bignum, '%#%', esc_url( get_pagenum_link($bignum) ) ),
'format' => '',
'current' => max( 1, get_query_var('paged') ),
'total' => $wp_query->max_num_pages,
'prev_text' => '&larr;',
'next_text' => '&rarr;',
'type' => 'list',
'end_size' => 3,
'mid_size' => 3
) );
echo '</div>';
} /* end page navi */
?>
<?php bones_page_navi(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment