Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Generates the user pagination for custom and default loops
- *
- * @global object $wp_query
- * @param object $query used within a custom loop
- */
- function home_pagination($query = null) {
- /*if ( !$query ) {
- global $wp_query;
- $query = $wp_query;
- } commented out because do I need this? */
- $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( 'page' ) ),
- 'total' => $query->max_num_pages,
- 'prev_text' => '« Previous',
- 'next_text' => 'Next »',
- ) );
- return $pagination;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement