Guest User

Untitled

a guest
Jan 21st, 2016
15
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.77 KB | None | 0 0
  1. //pagination
  2. $total = $wp_query->max_num_pages;
  3. // only bother with the rest if we have more than 1 page!
  4. if ($total > 1) {
  5.     $paginate_links = paginate_links(array(
  6.         'base' => get_pagenum_link(1) . '%_%',
  7.         'format' => 'page/%#%/',
  8.         'current' => max(1, get_query_var('paged')),
  9.         'total' => $total,
  10.         'mid_size' => 4,
  11.         'type' => 'list',
  12.         'prev_text' => '<',
  13.         'next_text' => '>',
  14.         'before_page_number' => ''
  15.     ));
  16.     $paginate_links = str_replace('//', '/', $paginate_links);
  17.  
  18.     echo '<nav role="navigation" class="navigation pagination"> <h2 class="screen-reader-text">Posts navigation</h2>';
  19.     echo '<div class="nav-links">';
  20.     echo $paginate_links;
  21.     echo '</div>';
  22.     echo '</nav>';
  23. }
Advertisement
Add Comment
Please, Sign In to add comment