About

Labels

slider

Recent

Navigation

Adsense ads between post in Blogger doesn't show [fixed]

The common problem with custom Blogger theme is showing up of Adsense ads between post. Blogger allow a user to add Adsense post before posts, in between posts and in the end. However this feature is available only when Blogger theme is designed in that way. Have a look how can we code a adsense friendly Blogger theme.
The adsense code depends on the code we add in loop tag in Blogger. Every widget have b:includable tag with id main. In post section we also have it.
<b:includable id='main' var='top'>
Under this tag we include all the widget content. The post comes under loop, this loop is quite helpful because you can individually handle each post. Here it is:
<b:loop values='data:posts' var='post'>
<b:include data='post' name='post' />
</b:loop>
This loop also container comment and other include tags, this is just a demo code. What really matters is adsense code inside the loop.
<b:if cond='data:post.includeAd'>
<div class='inline-ad'>
<data:adCode/>
</div>
</b:if>
This will add the adsense code in between the post. Just add this before </b:loop> and it will work great.
Share
Banner

Muhammad Hamza

Themelet provides the best in market today. We work hard to make the clean, modern and SEO friendly blogger templates.

Post A Comment:

0 comments: