Echo a shortcode div after every 3 posts
First, let’s clean up this tag SPAM nightmare so we can read it and then simplify the code: function adinserter() { return ‘abcdefg’; } if (have_posts()) { $count = 0; while (have_posts()) { the_post(); $count++; get_template_part( ‘content’, get_post_format() ); if ($count == 3) { if (function_exists (‘adinserter’)) { echo adinserter (1); } $count = 0; … Read more