Follow us on Facebook

How to Show Adsense ads After First Post in WordPress


Google Adsense is world’s most famous Online application to earn money from blogs and websites. Placing Google Ads on right place is an important strategy to increase Google Adsense earnings from same traffic. One of the way to increase Google ADSENSE earnings is to place Google Adsense ads after first post of WordPress Blog. This will catch the intention of Blog reader and he will surely click on any ad which will increase your Earnings. Anyways, Here is a method to Place Google Adsense ads after first post or second,third post of your wordpress blog. You can show affiliate banners and ads after first post in wordpress if you are not using Google Adsense. Its Up to you. Follow below given steps to Display Google Adsense Ads after First Post in WordPress.

  • Login in Your WordPress BLOG
  • Now Go to Dashboard > Appearance > Theme Editor
  • Click on Main Index Template (index.php) and start editing this file by following below given instructions.
  • Find This
<?php while (have_posts()) : the_post(); ?>
  • Replace This with Below Given Code.
<?php $adcount = 1; ?>
<?php while (have_posts()) : the_post(); ?>
  • Now Find
<?php endwhile; ?>

  • Replace Above Line with below given code:
<?php $adcount++; ?>
<?php endwhile; ?>
  • Now, Place Your Google Adsense Ad Script inside loop i.e. after “while” line but before “endwhile” code. You can choose exact location yourself by copy-pasting below given code:
<?php if ($adcount == 1) : ?>
<!– Put Your AdSense Code here –>
<?php endif; $adcount++; ?>
Example: If you want to place Google Adsense Ad after title of first post in wordpress then you need
  • Find This Code
<?php the_title(); ?></a>

  • And replace with
<?php the_title(); ?></a>
<?php if ($adcount == 1) : ?>
<!– Put Your AdSense Code here –>
<?php endif; $adcount++; ?>
If you follow example then Google Adsense Ads will display after the title of first post in WordPress. But you can change the location of Google Adsense in WordPress by placing above given code at your desired place in WordPress.

No comments:

Post a Comment

About

Followers

Like Us

Labels

Donate us For Furture