jawittdesigns
5/31/2014 - 10:03 PM

WordPress Custom Query Paged

WordPress Custom Query Paged

$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$query = new WP_Query(array(
  'post_type'              => 'post',
  'no_found_rows'          => true,
  'no_found_rows'          => true,  // useful when pagination is not needed.
  'update_post_meta_cache' => false, // useful when post meta will not be utilized.
  'update_post_term_cache' => false, //useful when taxonomy terms will not be utilized.
  'fields'                 => 'ids', //useful when only the post IDs are needed (less typical).
));
if (have_posts()) : 
  while ($query->have_posts()) : 
    $query->the_post();
    
  endwhile; 
endif; 
wp_reset_postdata();