Thursday, March 27, 2008

How to display adsense ads in blogger post page

This hack will display your adsense ad only in post page. Not in main page.

First,
Edit your template. tick the Expand Widget Templates.

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

Replace<p> </data:post.body></p> with the code below.

<b:if cond='data:blog.pageType == "item"'>
<--adsense code here 1>
<p><data:post.body/></p>
<--adsense code here 2>
<b:else/>
<p><data:post.body/></p>
</b:if>


Now,

1. If you want your adsense ad to appear exactly after post title and at the end of your post:
replace <--adsense code here1 > and <--adsense code here2 > with actual adsense code.

2. If you want adsense ad to appear after post title only:
replace <--adsense code here1 > with actual adsense code and remove the <--adsense code here2>

3.If you want adsense ad to appear
at the end of your post:
replace <--adsense code here2 > with actual adsense code and remove the <--adsense code here1>

No comments:

Post a Comment