Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Pagination
- function theme_name_pagination() {
- global $wp_query;
- if ( $wp_query->max_num_pages <= 1 ) return;
- $big = 999999999; // need an unlikely integer
- $pages = 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,
- 'type' => 'array',
- 'prev_text' => '<i class="flaticon-prev-1"></i>',
- 'next_text' => '<i class="flaticon-next-1"></i>',
- ) );
- if( is_array( $pages ) ) {
- $paged = ( get_query_var('paged') == 0 ) ? 1 : get_query_var('paged');
- echo '<div class="theme-pagination-one pt-15"><ul>';
- foreach ( $pages as $page ) {
- echo "<li>$page</li>";
- }
- echo '</ul></div>';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement