daily pastebin goal
43%
SHARE
TWEET

Pagination without a plugin

CodeMars Mar 24th, 2011 490 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <div class="paginate">
  2. <?php
  3.        
  4.         $total = $wp_query->max_num_pages;
  5.         $paged = !$paged ? 1 : $paged;
  6.  
  7.         $args = array('base' => add_query_arg('paged', '%#%'),
  8.           'format' => '', 'total' => $total, 'current' => $paged, 'echo' => false, 'end_size' => 5);
  9. ?>
  10.         <div class="navigation">
  11.           <?php echo paginate_links($args); ?>
  12.         </div>
  13.       </div>
  14.  
  15. reference: http://codex.wordpress.org/Function_Reference/paginate_links
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top