Post Query is Breaking CFS
-
When I run the code below, CFS no longer appears on the page when I run a get() function. It works perfectly when I run a get() function before the code below, but doesn’t appear after. Is there something wrong with this post query code?:
<?php $counter = 1; //start counter $grids = 3; //Grids per row $args = array( 'posts_per_page'=> 1, 'ignore_sticky_posts' => 0 ); $query = new WP_Query($args); if($query->have_posts()) : while($query->have_posts()) : $query->the_post(); ?> //Do stuff <?php $counter++; endwhile; endif; ?>
When I comment out sections, it appears that the “while($query->have_posts()) : $query->the_post();” is causing the error. Any idea why this would be?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Post Query is Breaking CFS’ is closed to new replies.