Created
March 23, 2016 15:32
-
-
Save streetcoder/65bfbaea8fe0ee293b0d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this code should underneat of loop | |
<?php | |
global $wp_query; | |
$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', | |
) ); | |
?> | |
<nav> | |
<ul class="pagination"> | |
<?php | |
foreach($pages as $page){ | |
echo '<li>' . $page . '</li>'; | |
} | |
?> | |
</ul> | |
</nav> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment