How to Insert Ads between Posts in WordPress

Today we are discuss about how to insert ads between posts in WordPress. There are Multiple way to insert adsense advertisement between posts in wordpress

You can add ads between post using the WordPress Plugin and Also Using the WordPress Coding.

You can add insert add between post using following the Plugin.

      1. Ad Inserter – WordPress Ads Management
      2. Insert Post Ads
      3. AdSense Plugin WP QUAD

You can Download Following Plugin using the WordPress.org or direct add using the WordPress Dashboard.

You can Also add Between Post using the Simple Php Functlity. You have to some change in Your Code. That is the Best way to Insert Ads between Posts in WordPress.

You have to Following the Simple Step

  1. Open Your single.php and Index.php (*This Name is Depend on your wordpress theme)
  2. Find the Following Code
    <?php while ( have_posts() ) : the_post(); ?>
  3. Copy this line and Paste this line 
    <?php $count = 1; ?>

    It’s Looking like this

    <?php $count = 1; ?>
    <?php while ( have_posts() ) : the_post(); ?>
  4. Paste this code in Your While loop
    <?php if ($count%2 == 0) : ?>
    <?php if ($count%2 == 0) : ?>
            // You ads is Repeat after every 2 Post
    	//Paste Your Adsense Code Here			
    <?php endif; $count++; ?>
    //Paste Your Adsense Code Here <?php endif; $count++; ?>

The Complete code is the something like this

<?php $count = 1; ?>
			<?php while ( have_posts() ) : the_post(); ?>
			    // Here is the Default Post Structure
                           
                                <?php if ($count%2 == 0) : ?>
					//Paste Your ads Code Here....
                                <?php endif; $count++; ?>
<?php endwhile; ?>

This is the Best and Easy Way to Insert ads Between Post without Using the Plugin. You can also using this code for Insert images text and video between Post.

Leave a Reply

Your email address will not be published. Required fields are marked *