How to Place Ads In Center Of Blogger Post
Updated on 16 May
So if you want to place your ads between your post you have to follow the steps which are provided below.
Steps to Place Ads in Center Of Post:
- Go To Blogger Dashboard
- Then Go to Theme / Template
- Click Edit HTML Button
- Now search for <data:post.body/>
- Now Replace the above code with the code provided below.
- We are all done but if you want to place your in other positions like left or right also have some distance Above and bottom you can use anyone code from below list that you like instead of above code.
- Replace highlighted text eg:(Your Ad Code Here) with your AD code.
- You are all done save your template and have a look.
To Search anything in blogger Press Ctrl + F and type or paste the term to search in search bar.
<div expr:id='"post1" + data:post.id'/>
<div class='googlepublisherads' style='margin:20px 0'>
<center>
Your Ad Code Here
</center>
</div>
<div expr:id='"post2" + data:post.id'><data:post.body/></div>
<script type='text/javascript'>
var obj0=document.getElementById("post1<data:post.id/>");
var obj1=document.getElementById("post2<data:post.id/>");
var s=obj1.innerHTML;
var t=s.substr(0,s.length/2);
var r=t.lastIndexOf("<br>");
if(r>0) {obj0.innerHTML=s.substr(0,r);obj1.innerHTML=s.substr(r+4);}
</script>
How to place ads in the centre of your post:
<div expr:id='"post1" + data:post.id'/>
<div class='googlepublisherads' style='margin:20px 0'>
<center>
<div style='margin:10px auto'>
Your Ad Code Here
</div>
</center>
</div>
<div expr:id='"post2" + data:post.id'><data:post.body/></div>
<script type='text/javascript'>
var obj0=document.getElementById("post1<data:post.id/>");
var obj1=document.getElementById("post2<data:post.id/>");
var s=obj1.innerHTML;
var t=s.substr(0,s.length/2);
var r=t.lastIndexOf("<br>");
if(r>0) {obj0.innerHTML=s.substr(0,r);obj1.innerHTML=s.substr(r+4);}
</script>
How to place ad at the Right Side of your post in the centre:
<div expr:id='"post1" + data:post.id'/>
<div class='googlepublisherads' style='margin:20px 0'>
<center>
<div style='float:right;margin:10px 0 10px 10px'>
Your Ad Code Here
</div>
</center>
</div>
<div expr:id='"post2" + data:post.id'><data:post.body/></div>
<script type='text/javascript'>
var obj0=document.getElementById("post1<data:post.id/>");
var obj1=document.getElementById("post2<data:post.id/>");
var s=obj1.innerHTML;
var t=s.substr(0,s.length/2);
var r=t.lastIndexOf("<br>");
if(r>0) {obj0.innerHTML=s.substr(0,r);obj1.innerHTML=s.substr(r+4);}
</script>
How to place ad at the Left Side of your post in the centre:
<div expr:id='"post1" + data:post.id'/>
<div class='googlepublisherads' style='margin:20px 0'>
<center>
<div style='float:left;margin:10px 10px 10px 0'>
Your Ad Code Here
</div>
</center>
</div>
<div expr:id='"post2" + data:post.id'><data:post.body/></div>
<script type='text/javascript'>
var obj0=document.getElementById("post1<data:post.id/>");
var obj1=document.getElementById("post2<data:post.id/>");
var s=obj1.innerHTML;
var t=s.substr(0,s.length/2);
var r=t.lastIndexOf("<br>");
if(r>0) {obj0.innerHTML=s.substr(0,r);obj1.innerHTML=s.substr(r+4);}
</script>
Conclusion:
You are all done now you have to make some changes in the court provided above you have to replace the highlighted text with your ad code.
After you have pasted your ad code then this code with work absolutely fine.
Source: softwebtuts.com
0 comments for How to Place Ads In Center Of Blogger Post