Blogger

Add Adsense BelowTitle-MidPost-BelowPost in Blogger

Now you can Add Adsense code below title in your blogger blog and as well as also use adsense code to Mid post of your blog and Below post of your blogger blog.Because google adsense is main source of income or you can easily earn money by placing google adsense code at various places in your blogger blog.. In this article,you will learn how to Add Adsense BelowTitle-MidPost-BelowPost in Blogger.

Display AdSense Inside Blogger Post Automatically

Here under is a script that will show ads at the start and middle of the post automatically. This script finds the middle part of the blog post and automatically place an ad. For some blog like tech blogs where HTML code sharing is common will not work perfectly it might come between shared code. But on all other blogs, it will work perfectly.

This code is also for those who are using scripts to show the post excerpt on their home page.

Add Adsense BelowTitle-MidPost-BelowPost in Blogger

Add Adsense BelowTitle-MidPost-BelowPost in Blogger

CASE-I: For those who are using post excerpt on the home page.
To use this script go to theme HTML and search for <data:post.body/> and replace this code with the following code, and hit the save button.

CASE-II: For those who are using default Blogger theme i.e. no post excerpt on the home page.
To use this script go to theme HTML and search for <data:post.body/> and replace this code with the following code,

<b:if cond='data:blog.pageType == &quot;index&quot;'>
<data:post.body/>
</b:if>

Now paste the following code just above it, and hit the save button.

<!-- Ads in mid of post: automatically -->
<b:if cond='data:blog.pageType == &quot;item&quot;'>
<div expr:id='"atmid" + data:post.id'/>
<div style="clear:both; margin:10px 0;text-align:center">
<!-- Paste Ad code here: Appear at mid of the post -->
</div>
<div expr:id='"attop" + data:post.id'>
<div style="clear:both; margin:10px 0;text-align:center">
<!-- Paste Ad code here: Appear at top of the post -->
</div>
<data:post.body/>
<div style="clear:both; margin:10px 0;text-align:center">
<!-- Paste Ad code here: Appear at bottom of the post -->
</div>
</div>
</b:if>

<script type="text/javascript">
var obj0=document.getElementById("atmid<data:post.id/>");
var obj1=document.getElementById("attop<data:post.id/>");
var s=obj1.innerHTML;
var t=s.substr(0,s.length/2);
var r=t.lastIndexOf(" ");
if(r>0) {obj0.innerHTML=s.substr(0,r);obj1.innerHTML=s.substr(r+1);}
</script>
<!-- Ads in mid of post: automatically -->

Note: You have to parse the adsense javascript code before placing 
in the blogger ,you can parse the code from here

Learn How to Display Adsense ads on Certain Posts in Blogger

Related Articles

Leave a Reply

Close
Close

Adblock Detected

Please consider supporting us by disabling your ad blocker