Last active
September 6, 2024 07:42
-
-
Save atomjoy/909b6623f83a5bd233ef00a8fb5de510 to your computer and use it in GitHub Desktop.
Wordpress custom pagination links function.
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
<div class="navigation"> | |
<?php | |
global $wp_query; | |
$big = 999999999; // need an unlikely integer | |
echo 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, | |
'prev_text' => __('« Prev'), | |
'next_text' => __('Next »'), | |
) ); | |
?> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment