Home » Wordpress » How to put Adsense ads Between the post on your WordPress Homepage

How to put Adsense ads Between the post on your WordPress Homepage

How to put Adsense ads Between the post on your WordPress Homepage: One of the main reasons for showing ads between the posts is that it is the most effective places to insert ads after the first post and it might possibly increase revenue. it is more efficient and cleaner also looks.

Now You are going to learn how to insert ads between posts in your WordPress homepage:

  1. Login to your WordPress site and go to your WordPress Dashboard, go to Appearance in the menu and select Editor
  2. Locate and open index.php or loop.php (this will depend on your theme template) and see a line of code like this:

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

3. Once you have found it, you have to insert the line given above:

<?php $count = 1; ?>

4. After this, find the following line that looks like this:

<?php endwhile; ?>

5. Once you have found it, you need to include the following lines of code from the Google AdSense code or ad company that you are using it:

<?php if ($count == 1) : ?>
YOUR GOOGLE ADSENSE CODE HERE
<?php endif; $count++; ?>

Here digit 1 in <?php if ($count == 1) : ?> is indicates the position where ads will be placed in this case after the first post.If you want to insert ads after the third, fourth post … you have to increase this number in 3 or 4 and so on.

Read More: How To Add Adsense ads below Headers In WordPress website

Read More: How to put Adsense ads in a widget or in the sidebar

Leave a Reply

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

*
*