infinitescroll and wp_query is repeating posts
-
I am trying to figure out why the infinitescroll is repeating the first page over and over and over.
I am using a static front page and have built a custom query.
<?php /* Template Name: Main */ get_header(); $paged = ( get_query_var('page') ) ? get_query_var('page') : 1; // WP_Query arguments $args = array ( 'post_type' => array('post','post_bike'), 'pagination' => true, 'posts_per_page' => '10', 'order_by' => 'date', #'paged' => $paged, ); // The Query $wp_query = new WP_Query( $args ); #var_dump($wp_query->found_posts); // The Loop if ( $wp_query->have_posts() ) { #var_dump($query); $wp_query->the_post(); // do something include (TEMPLATEPATH . '/php/article-class.php' ); #get_template_part('/php/article-class', get_post_format()); } echo'HERE IS NAV'; include (TEMPLATEPATH . '/inc/nav.php' ); echo'END NAV'; } else { // no posts found echo "<h2>Not Found</h2>"; } // Restore original Post Data wp_reset_postdata(); get_footer(); ?>
Any help is greatly appreciatd, this is driving me crazy.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘infinitescroll and wp_query is repeating posts’ is closed to new replies.