Wednesday, July 21, 2010

How to Show Adsense Ads Only on Homepage or Post pages on Blogger


Now that you have learned how to place adsense ads in between your blog posts some of you may want to show adsense ads only on blog homepage or blog post page only. Here is a easy trick to do this.

Go to Dashboard > Layout > Edit HTML > Expand Widget Templates.

To show ads on homepage only,

If you want to add your ads after post title but only show in homepage

<div class='post-header-line-1'/>

<div class='post-body entry-content'>

<b:if cond='data:blog.pageType != &quot;item&quot;'>


YOUR ADVERTISEMENT CODE

span>b>

</b:if>




<p><data:post.body/></p>



<div style='clear: both;'/>

<!– clear for photos floats –> </div>

Show ads on blog posts only, modify your code like this :



YOUR ADVERTISEMENT CODE

UPDATE
Here is another solution I found

Get your adsense code and paste it to Notepad. Now remove the line breaks and comments from the Adsense code. Do not modify the ad script. It should look like:

[adsense.JPG] 

Now add this code using this code.


    YOUR AD CODE HERE

   

No comments:

Post a Comment