Created
November 24, 2018 07:01
-
-
Save pvphong90/a4a58e08036279571d91aeaf5db6f92d to your computer and use it in GitHub Desktop.
Code phân trang wordpress
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
function html5wp_pagination() | |
{ | |
global $wp_query; | |
$big = 999999999; | |
$pages = paginate_links(array( | |
'base' => str_replace($big, '%#%', get_pagenum_link($big)), | |
'format' => '?paged=%#%', | |
'current' => max(1, get_query_var('paged')), | |
'total' => $wp_query->max_num_pages, | |
'type' => 'array', | |
)); | |
if( is_array( $pages ) ) { | |
$paged = ( get_query_var('paged') == 0 ) ? 1 : get_query_var('paged'); | |
echo '<div class="text-center"><ul class="pagination bounceInUp animated wow" data-wow-delay=".8s">'; | |
foreach ( $pages as $page ) { | |
echo "<li>$page</li>"; | |
} | |
echo '</ul></div>'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment