Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function keha76_pagination()
- {
- global $wp_query;
- $total_pages = $wp_query->max_num_pages;
- if( $total_pages > 1 )
- {
- $current_page = max( 1, get_query_var('paged') );
- echo '<nav id="pagination" role="navigation">';
- echo paginate_links(
- array(
- 'base' => get_pagenum_link(1) . '%_%',
- 'format' => '/page/%#%',
- 'current' => $current_page,
- 'total' => $total_pages,
- 'end_size' => 2,
- 'mid_size' => 2,
- 'prev_text' => __( '← Prev' ),
- 'next_text' => __( 'Next →' )
- )
- );
- echo '</nav>';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement