Advertisement
CodeMars

Pagination without a plugin

Mar 24th, 2011
526
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement