Header Ads Widget

Responsive Advertisement

How to Add Adsense or Any Ads In the Middle of Blogger Post




Step 1: Login to your blogger account and select the blog you want to edit.
Step 2: Go to Theme and click on Edit HTML.
Step 3: Click anywhere inside the code area.
Step 4: Press Ctrl+F from keyboard to open a search bar.
Step 5: Now search <data:post.body/> code and replace this code in your template with the below code.
Note: Inside of your template, you will find <data:post.body/> code multiple time depending on the template used, try one by one until the ad appears on the article page.
<div expr:id='"mad1" + data:post.id'/>
<div style="margin:20px auto;text-align:center;overflow:hidden;">
<!-- Add your ad code here -->
</div>
<div expr:id='"mad2" + data:post.id'><data:post.body/></div>
<script type='text/javascript'>
var obj0=document.getElementById(&quot;mad1<data:post.id/>&quot;);var obj1=document.getElementById(&quot;mad2<data:post.id/>&quot;);var s=obj1.innerHTML;var t=s.substr(0,s.length/2);var r=t.lastIndexOf(&quot;&lt;br&gt;&quot;);if(r&gt;0) {obj0.innerHTML=s.substr(0,r);obj1.innerHTML=s.substr(r+16);}
</script>
Customize: Replace <!-- Add your ad code here --> with your adsense or other any kind of ad code.
Step 6: Click on Save theme and see the result.

  • Convert Ad code before Paste here

ad and can paste, by replacing <!-- Add your ad code here -->code.

That's it. Happy Commenting!

Post a Comment

0 Comments