My goal is to print some extra html, after every four posts. What is wrong with the following code <?php while ( have_posts() ) : the_post(); ?> <?php wc_get_template_part( 'content', 'product' ); ?> <?php $posts = $wp_query->post_count; if ( $posts == 4 ) { echo '<div class="clearfix"></div>'; } ?><?php endwhile; // end of the loop. … Continue reading In WordPress loop, how do I check how many post have been looped through?
The post In WordPress loop, how do I check how many post have been looped through? appeared first on Clan VPS Host.