Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*########################################################################
- /////////////////////// Codigo Paginación con Bootstrap \\\\\\\\\\\\\\\\\\
- ##########################################################################*/
- if (! function_exists('gymclub_pagination_crud')) {
- function gymclub_pagination_crud(){
- global $wp_query;
- $pages = paginate_links( [
- 'format' => '?paged=%#%',
- 'current' => max( 1, get_query_var( 'paged' ) ),
- 'total' => $wp_query->max_num_pages,
- 'type' => 'array',
- 'show_all' => false,
- 'end_size' => 3,
- 'mid_size' => 1,
- 'prev_next' => true,
- 'prev_text' => __( '<< Anterior', 'gymclub' ),
- 'next_text' => __( 'Siguiente >>', 'gymclub' ),
- 'add_args' => false
- ]
- );
- if ( is_array( $pages )) {
- $pagination = '<div class="clearfix"></div><ul class="pagination">';
- foreach ($pages as $page) {
- $pagination .= '<li class="page-item ' .(strpos($page, 'current') !== false ? 'active' : ''). '"> ' . str_replace( 'page-numbers','page-link', $page ). '</li>';
- }
- $pagination .= '</ul>';
- return $pagination;
- }
- return null;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement