Add Ads between WordPress Posts
WordPress tutorial to add ads between post in home page or category, archive page. You can add any kind of ad link Google AdSense ad, buy sell ad or affiliate ad.
First login your WordPress admin panel.
Go to Appearance -> Editor.
Open index.php or loop.php.
Search and find this code or similar code.
<?php while (have_posts()) : the_post(); ?>
Add the following code above line.
<?php $count = 1; ?>
Next find the code look like this
<?php endwhile; ?>
Add the following code above the line
<?php if ($count == 1) : ?> YOUR GOOGLE ADSENSE CODE HERE <?php endif; $count++; ?>
Replace “YOUR GOOGLE ADSENSE CODE HERE” code with your ad code.
If you want appear your ad after some post, change the code like this
Ex: after 4th post
<?php if ($count == 4) : ?> YOUR GOOGLE ADSENSE CODE HERE <?php endif; $count++; ?>