Insert and display image ad after 3 posts in wordpress

Description

Insert and display image ad after 3 posts in WordPress. How to add google ads in front page after 3 Post. How to show ads and content after some post in WordPress. Display same ads after 2 or 4 Post in WordPress. Add and show content in between post list use if else condition WordPress 

How to and and Insert Ads In Between post list In WordPress, Without Any Plugin

Using if-else condition insert add in between post list Wordpress

First, find post while loop condition in index.php or loop.php  and another file according to your theme.

 <?php while ( have_posts() ) : the_post(); ?>

And now insert this if else condition code

<?php if ($count == 1 || $count == 3 || $count == 5) : ?>

YOUR GOOGLE ADSENSE CODE HERE

<?php endif; $count++; ?>

2nd type

<?php $post_counter++; 

if ($post_counter == 2 ) { ?>

INSERT ADSENSE CODE HERE

<?php }  ?>

Insert the if else code in while loop show check it

 <?php

// Start the loop.

while ( have_posts() ) : the_post(); ?>

<?php if ($count == 1 || $count == 3 || $count == 5) : ?>

YOUR GOOGLE ADSENSE CODE HERE

<?php endif; $count++; ?>