Forums
Home / Fixing WordPress / display ad after every 4 post in index.php
(@yashmistrey)
12 years, 8 months ago
how do i crate ad space after every 4 posts on index.php (home page) here is the code i am using
<?php if ($count==4) { ?> <?php dynamic_sidebar('index-insert') ?> <?php } ?> <?php $count = $count + 1; ?> <?php endwhile; else: ?>
it display ad after 4th post,
i want to display ad after every 4 post
thanks in advance
(@esmi)
<?php if ($count==4) : dynamic_sidebar('index-insert'); $count = 1; else $count = $count + 1; endif; endwhile; else: ?>
thanks esmi ! sorry for trouble thats not working i am using this code.. how to edit this
<?php if ($count==3) { ?> <div class="clear"> </div> < --- ad space --- > <div class="clear"> </div> <?php } ?> <?php $count = $count + 0; ?> <?php endwhile; else: ?>