GeeksFlame
A Flame Spreading Tips & Tricks

Adding Adsense ads code in Center of Blog posts

4 8

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.


4 Comments
  1. Darrin Benner says

    When I started my blog I have read a lot about Google AdSense and how to make money from it?
    But after getting engaged with blogging it feels amazing and money is not the only concern.
    I haven’t put any ad at my blog yet.

    There are many bloggers who just think to manipulate Google for making some dollars. But in real sense they are temporary.

    Having Google AdSense ads is the way to make money if do hard work to drive traffic at our blog.

    Patience is what beginners need.

    1. Varundeep Singh says

      True Darrin

  2. Ashley Jones says

    Very useful post, thank you so much for sharing
    Actually i have heard about clicksor but i haven’t ever tried the others yet.. but i agree with you that recently google adsense is becoming stricter. It’s neccessary for us to find another ways to survive in making money online.

  3. Vikash Kushwaha says

    have there any way to show AdSense ads after every paragraph of post

Leave A Reply

Your email address will not be published.