Adding Adsense ads code in Center of Blog posts


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.


About the Author

Varundeep Singh
Hi, I am Varundeep Singh owner of this blog and a Mechanical engineer. I am here to blog all the stuff related to technology, blogging, gadgets, pc-tricks and much more. Blogging is my best hobby as i am just madly in love with it!

3 Comments on "Adding Adsense ads code in Center of Blog posts"

  1. Darrin Benner | April 29, 2016 at 12:55 pm | Reply

    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.

  2. Ashley Jones | June 22, 2016 at 7:06 pm | Reply

    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.

Leave a comment

Your email address will not be published.


*