Advertisement
Guest User

Untitled

a guest
Aug 17th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. function pagination() {
  2. global $wp_query;
  3.  
  4. $total_pages = $wp_query->max_num_pages;
  5.  
  6. if ($total_pages > 1){
  7. $current_page = max(1, get_query_var('paged'));
  8.  
  9. echo paginate_links(array(
  10. 'base' => get_pagenum_link(1) . '%_%',
  11. 'format' => '/page/%#%',
  12. 'current' => $current_page,
  13. 'total' => $total_pages,
  14. ));
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement