Guest User

Untitled

a guest
Jul 18th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. // Create pagination
  2. function bootstrap_pagination( $query = '' ) {
  3. if ( empty( $query ) ) {
  4. global $wp_query;
  5. $query = $wp_query;
  6. }
  7.  
  8. $big = 999999999;
  9.  
  10. $links = paginate_links( array(
  11. 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
  12. 'format' => '?paged=%#%',
  13. 'prev_next' => true,
  14. 'prev_text' => '«',
  15. 'next_text' => '»',
  16. 'current' => max( 1, get_query_var( 'paged' ) ),
  17. 'total' => $query->max_num_pages,
  18. 'type' => 'list'
  19. ) );
  20.  
  21. $pagination = str_replace( 'page-numbers', 'pagination', $links );
  22.  
  23. echo $pagination;
  24. }
Add Comment
Please, Sign In to add comment