Adsense between blog posts

You can put Google Adsense ad code anywhere in the blog post whether in it’s centre or anywhere else. Last time I discussed about Adding ad code under Post Title


Follow the simple steps for placing ads between blog posts:

Step 1. First of all, go to Templates > Edit HTML then press ctrl+F and search for code below.

 <data:post.body/>

Note: if there are 2 or 3 same code then replace 2nd and if it not works then choose 3rd.

Step 2. Replace  <data:post.body/>  with below code.

 <div expr:id='”adsmiddle1″ + data:post.id’></div>
<b:if cond=’data:blog.pageType == “item”‘>
<b:if cond=’data:blog.pageType != &quot;static_page&quot;’>
<div style=”clear:both; margin:10px 0″>
<!– Add here the code of your ad –>
</div>
</b:if>
</b:if>
<div expr:id='”adsmiddle2″ + data:post.id’>
<data:post.body/>
</div>
<script type=”text/javascript”>
var obj0=document.getElementById(“adsmiddle1<data:post.id/>”);
var obj1=document.getElementById(“adsmiddle2<data:post.id/>”);
var s=obj1.innerHTML;
var r=s.search(/x3C!– adsense –x3E/igm);
if(r>0) {obj0.innerHTML=s.substr(0,r);obj1.innerHTML=s.substr(r+16);}
</script>


Step 3. Convert the code and then put the converted ad code in place of  ‘<!– Add here the code of your ad –>’  and Click”Save Template”
To put the ad in centre then add </center> above as well as below the ad code as give below.

 <div style=”clear:both; margin:10px 0″>
<center> 
<!– Add here the code of your ad –>
</center>
</div>


Step 4. To choose where to put ad between post, go to HTML Editor of post and type <!– adsense –>  

Blogger Post 

Note: if you will not add code ‘<!– adsense –>’ then ad will be shown below post title by default.

0 Shares:
Leave a Reply

Your email address will not be published. Required fields are marked *

You May Also Like