Skip to content

Instantly share code, notes, and snippets.

@anova
Created June 22, 2013 15:55
Show Gist options
  • Save anova/5841366 to your computer and use it in GitHub Desktop.
Save anova/5841366 to your computer and use it in GitHub Desktop.
<?php
function rgicgier_pagination($query = null) {
if ( !$query ) {
global $wp_query;
$query = $wp_query;
}
$big = 999999999; // need an unlikely integer
$pagination = paginate_links( array(
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
'format' => '?paged=%#%',
'current' => max( 1, get_query_var( 'paged' ) ),
'total' => $query->max_num_pages,
'prev_text' => '&laquo; Previous',
'next_text' => 'Next &raquo;',
'type' => 'list',
) );
?>
<div class="pagination">
<ul>
<?php echo $pagination; ?>
</ul>
</div>
<!-- ####################################################################################################### -->
<?php
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment