How to Show Ads on Wordpress Homepage Only
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.
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
- Login to your Wordpress dashboard
- Navigate to Appearance >> Editor >> Index.php
- Choose the location where you want to display the ad and paste the following code there
- Replace the line YOUR ADVERTISEMENT HERE with your ad code.
- Save the changes and you are done.
<?php if(is_home() && $post==$posts[0] && !is_paged()) { ?>
YOUR ADVERTISEMENT CODE HERE
<?php } ?>
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.
- Download Whydowork Adsense wordpress plugin.
- After installation, activate it from Plugins control panel.
- Navigate to Settings >> Whydowork Adsense
- 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.
- Paste your ad code into Ad Code#1 and save it.
- Scroll down to Front Page (categories, archive) and select Ad Code#1 there.
- Manage your ad alignment and select the post nos where you want the ad to get displayed.
- Save the settings and you are Done.
That’s it. Now you can show ads on wordpress blog’s homepage only.
|
Important Recommendation: Run a Free Scan for Windows Errors Installing or uninstalling software can leave your registry fragmented with corrupted or harmful files. Check your registry with RegistryBooster |
Related Posts
- Show Adsense Ads Only on Homepage or Post pages on Blogger and Wordpress
- How To Create an Archive Page for Your Wordpress Blog
- Read More Plugin to show Post Summary with Thumbnails Automatically on Blogger Homepage
- Fix “You Do Not Have Sufficient Permissions to Access this Page” Wordpress Plugin Error
- Doing Wordpress SEO? Try HeadSpace2 SEO Plugin




















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?
Hi sir…this is nice..
but the problem is how to put ad in archive.php page…?
@ Online Earning : Edit your archive.php file to manually add your Adsense code into it.
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..
Might be the one i’m looking for. Thanks for sharing.
this is very useful tips and i am agree why do work adsense is the best one