This article will explain how to place or add an Adsense or other ads in the middle of article post on the your blog page. And how to put it? To put Adsense in the middle of the post is actually quite easy to do. Here are some easy steps to put AdSense in the central part of the post:
- Log in to Blogger
- Click the Theme menu. Do not forget to do a backup template in case an error occurs.
- Click the Edit HTML
- Find <data: post.body /> located before the condition tag code <b: if cond = 'data: the blog.pageType == & quot; item & quot;'>
- >Next, replace the code <data: post.body /> with the following code:
<div expr:id='"ads1" + data:post.id'></div>
<div style = clear:both; margin:10px 10px">
PUT PARSED ADSENSE SCRIPT HERE
</ div>
<div expr:id='"ads2" + data:post.id'><data:post.body/></div>
<script type="text/javascript">
var obj0=document.getElementById("ads1<data:post.id/>");
var obj1=document.getElementById("ads2<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>
Put parsed Adsense script in blue letters area. To parse Adsense script please use
this parser tool .
Number 2 in the line of code var t = s.substr (0, s.length / 2) showing the distribution segment of the post. Number 2 means Adsense in the middle of the post.
If replaced with 4, then the Adsense will be in the first 1/4 part of article post.
That is how to place an adsense in the middle of blog posts. Hopefully these tips can give your inspiration to improve your blogthis parser tool .
Number 2 in the line of code var t = s.substr (0, s.length / 2) showing the distribution segment of the post. Number 2 means Adsense in the middle of the post.
If replaced with 4, then the Adsense will be in the first 1/4 part of article post.
Post a Comment