Created
May 5, 2021 21:02
-
-
Save mikeoberdick/b344658d84b666572e404aa14dedd460 to your computer and use it in GitHub Desktop.
pagination for default query
This file contains 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
<div class="pagination"> | |
<?php | |
echo paginate_links( array( | |
'base' => str_replace( 999999999, '%#%', esc_url( get_pagenum_link( 999999999 ) ) ), | |
'total' => $qry->max_num_pages, | |
'current' => max( 1, get_query_var( 'paged' ) ), | |
'format' => '?paged=%#%', | |
'show_all' => false, | |
'end_size' => 2, | |
'mid_size' => 1, | |
'prev_next' => false, | |
'add_fragment' => '', | |
) ); | |
?> | |
</div><!-- .pagination --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment