Rabu, 02 Maret 2011

Show Adsense Ads Only on Homepage or Post pages on Blogger and WordPress

Having same ad format all over your blogs might lead to a lower CTR since your visitors will get familiar with your regular ad formats and locations. It’s a wise idea to show different ad formats on different pages. Yes, you can show different ads on homepage and post pages on your Blogger or self hosted WordPress blogs. All you have to do is use the conditional tags with the ad code. You may use a conditional tag to show ads only on homepage and another conditional tag to show ads only on post pages. In this way, you can show different ads on homepage and blog post pages.
On Solidblogger, you can see banner sized ads (468*60) on the homepage while individual post pages will show square size ads (336*280 and 300*250). If you want to show different ads on your blog also, you can do this easily by adding a conditional tag.
show different ads on blogger or wordpress

Show Adsense ads on homepage or individual blog posts on Blogger

To show ads on homepage only, modify your code like this :
<b:if cond='data:blog.pageType != &quot;item&quot;'> YOUR ADVERTISEMENT CODE </b:if>
To show ads on individual blog posts only, modify your code like this :
<b:if cond='data:blog.pageType == &quot;item&quot;'> YOUR ADVERTISEMENT CODE </b:if>

Show Adssense Ads on Homepage or individual posts only on WordPress blogs

To show ads only on WordPress homepage, modify your code like the following example :
<?php if (is_home()) { ?>
YOUR ADVERTISEMENT CODE
<?php } ?>
To show ads only on individual blog posts only, modify code like this :
<?php if (is_single()) { ?>
YOUR ADVERTISEMENT CODE
<?php } ?>
Replace YOUR ADVERTISEMENT CODE with your actual Google Adsense ad code. If you want to show the same ads everywhere, simply remove the above conditional tags and keep the advertisement code only.