Thursday, November 17, 2016

How To Add Adsense in the Middle of the Post in Blogger

Add Adsense in the Middle of the Post

  • Login to Blogger > Dashboard
  • Click on Drop Down Menu and select Template
  • Backup your Template before making any changes to your blog
  • Now Click on Edit HTML > Proceed >  Expand Widget Templates
  • Press Ctrl + F and search the code shown below.
<data:post.body/>
You will find two times <data:post.body/> code and You have to Replace it With the Second One
  • Now replace that code with below code.

<div expr:id=’&quot;aim1&quot; + data:post.id’/>
<div style=’clear:both; margin:10px 0′>
Your Adsense Code Here
</div>
<div expr:id=’&quot;aim2&quot; + data:post.id’>
<data:post.body/>
</div>
<script type=’text/javascript’>
var obj0=document.getElementById(&quot;aim1<data:post.id/>&quot;);var obj1=document.getElementById(&quot;aim2<data:post.id/>&quot;);var s=obj1.innerHTML;var t=s.substr(0,s.length/2);var r=t.lastIndexOf(&quot;&quot;);if(r&gt;0){obj0.innerHTML=s.substr(0,r);obj1.innerHTML=s.substr(r+1)}
</script>
 You Have to first Convert the Adsense Code into the Compartible Form

  • Now just replace Your Adsense Code Here with your Own Asense Codes.
  • Now Save Your template.

0 comments:

Post a Comment