jawittdesigns
8/29/2014 - 1:53 PM

WordPress - Custom Query Static Frontpage with Pagination

WordPress - Custom Query Static Frontpage with Pagination

if ( get_query_var('paged') ) :
    $paged = get_query_var('paged'); 
elseif ( get_query_var('page') ) :
    $paged = get_query_var('page'); 
else :
    $paged = 1; 
endif;
$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();