Advertisement
Guest User

paginador

a guest
Jul 15th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.15 KB | None | 0 0
  1.     function get_paginacion_propiedades($wp_query)
  2.     {
  3.         global $wp_rewrite;
  4.         $pages = '';
  5.         //Calcular de paginas que tiene
  6.         $max = $wp_query->max_num_pages;
  7.  
  8.         //Que pagina estoy
  9.         global $paged;
  10.         $current = ($paged) ? $paged : 1;
  11.         $a['base'] = @add_query_arg('page','%#%');
  12.         $a['total'] = $max;
  13.         $a['current'] = $current;
  14.         $total = 1; //1 - display the text "Page N of N", 0 - not display
  15.         //Links a izquierda y derecha
  16.         $a['mid_size'] = 3; //how many links to show on the left and right of the current
  17.         $a['end_size'] = 1; //how many links to show in the beginning and end
  18.         //$a['prev_text'] = '<'; //text of the "Previous page" link
  19.         $a['prev_text'] = 'Anterior';
  20.         $a['next_text'] = 'Siguiente';
  21.         if ($max > 1) {
  22.             echo '<div class="enigma_blog_pagination">';
  23.         }
  24.         echo '<div class="enigma_blog_pagi">';
  25.         if ($total == 1 && $max > 1) {
  26.             //$pages = '<span class="pages">Page ' . $current . ' of ' . $max . '</span>'."\r\n";
  27.             echo $pages . paginate_links($a);
  28.         }
  29.         if ($max > 1) {
  30.             echo '</div>';
  31.         }
  32.         echo '</div>';
  33.  
  34.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement