Skip to content

Instantly share code, notes, and snippets.

@zenman
Created June 4, 2013 19:41
Show Gist options
  • Save zenman/5708885 to your computer and use it in GitHub Desktop.
Save zenman/5708885 to your computer and use it in GitHub Desktop.
Add basic WordPress pagination.
<?php
global $wp_query;
$big = 999999999;
echo paginate_links( array(
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
'format' => '?paged=%#%',
'current' => max( 1, get_query_var('paged') ),
'total' => $wp_query->max_num_pages,
'prev_next' => false
));
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment