Skip to content

Instantly share code, notes, and snippets.

@onishiweb
Created August 22, 2016 11:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save onishiweb/d8b49682375980cfda539f345be4167e to your computer and use it in GitHub Desktop.
Save onishiweb/d8b49682375980cfda539f345be4167e to your computer and use it in GitHub Desktop.
<?php
/**
* Pagination example
*/
global $wp_query;
$big = 999999999; // need an unlikely integer
echo paginate_links( array(
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
'format' => '/page/%#%',
'current' => max( 1, get_query_var('paged') ),
'total' => $wp_query->max_num_pages,
'prev_next' => True,
'prev_text' => __('« Newer posts'),
'next_text' => __('Older posts »'),
) );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment