domegang

pagination-solution

Mar 12th, 2014
197
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. if ( get_query_var('paged') ) {
  4. $paged = get_query_var('paged');
  5. } else if ( get_query_var('page') ) {
  6. $paged = get_query_var('page');
  7. } else {
  8. $paged = 1;
  9. }
  10.  
  11. $my_args = array(
  12. 'post_type' => 'auto',
  13. 'posts_per_page' => 6,
  14. 'paged' => $paged
  15. );
  16.  
  17. query_posts( $my_args );
  18.  
  19. ?>
  20.  
  21. <?php if ( have_posts() ) : while (have_posts()) : the_post(); ?>
RAW Paste Data