Recommended: Fix Windows Errors and Improve PC Performance

How to Show Ads on Wordpress Homepage Only

Posted by Bapun 18 April, 2009

When it comes to showing ads on wordpress, you can go creative and implement your own ideas. Showing ads on your wordpress home page only is a nice idea to attract more clicks. Since we bloggers are habituated to put ads on few specific locations, this change will bring some freshness as well as more CTR. And yes, these homepage ads will be visible on your blog’s homepage only, it has nothing to do with your post pages. Let’s know how to enable and show ads on wordpress homepage only.

show ads on your wordpress blog homepage only

We can do this in two ways. We can either edit our theme and insert the ad code to show the ad or we can use a wordpress plugin called Whydowork Adsense to do this automatically. Let’s know both tricks step by step.

Edit Theme to show Ads on Wordpress Homepage Only

  1. Login to your Wordpress dashboard
  2. Navigate to Appearance >> Editor >> Index.php
  3. Choose the location where you want to display the ad and paste the following code there
  4. <?php if(is_home() && $post==$posts[0] && !is_paged()) { ?>
    YOUR ADVERTISEMENT CODE HERE
    <?php } ?>

  5. Replace the line YOUR ADVERTISEMENT HERE with your ad code.
  6. Save the changes and you are done.

This trick was written by John P on his blog.

Show Ads on Wordpress Homepage Only using Plugin

If you are not comfortable in editing theme files, you can use a wordpress plugin to do this for you. Whydowork Adsense is one of the best adsense plugins I’ve ever used. This gives you the freedom to show your ads on either post pages or homepages or both. It also allows you to align your ad to fit better with your theme. Let’s know how to use it.

  1. Download Whydowork Adsense wordpress plugin.
  2. After installation, activate it from Plugins control panel.
  3. Navigate to Settings >>  Whydowork Adsense
  4. You can find various options there. You can add up to 10 advertisement codes and customize it to show on different locations of your wordpress blog.
  5. Paste your ad code into Ad Code#1 and save it.
  6. Scroll down to Front Page (categories, archive) and select Ad Code#1 there.
  7. Manage your ad alignment and select the post nos where you want the ad to get displayed.
  8. Save the settings and you are Done.

That’s it. Now you can show ads on wordpress blog’s homepage only.

We will send you some more information related to How to Show Ads on Wordpress Homepage Only

Categories : Wordpress Tags : , , ,

Comments
May 3, 2009

It’s the first time I commented here and I must say you share us genuine, and quality information for bloggers! Good job.
p.s. You have a very good template for your blog. Where did you find it?

Posted by mssmotorrd
July 25, 2009

Hi sir…this is nice..
but the problem is how to put ad in archive.php page…?

Posted by online earning
July 25, 2009

@ Online Earning : Edit your archive.php file to manually add your Adsense code into it.

Posted by Bapun
July 26, 2009

It was a great script sir. I learn a new function here, that is trigger_error() function. This script would help me much if i forgot which wordpress function i’ve ever modified using add_filter().

Thank you so much sir..

Posted by china wholesale
August 1, 2009

Might be the one i’m looking for. Thanks for sharing.

Posted by noone
November 7, 2009

this is very useful tips and i am agree why do work adsense is the best one

Posted by tips
Leave a comment

(required)

(required)


Top incoming search terms for this post