Ads in middle of posts

, Posted by ngsk at 11:21 PM

Every people want to place the ads in the middle of the posts as this help them to get good revenue. How to insert ads in middle of posts?

Here goes a small trick to insert your Adsense ads into middle of your posts.

Before going for this trick Save your template.
To save your template
Go to the Layout tab, and click Edit HTML.
Download your template as an XML-file and save it onto your harddisk. If anything goes wrong, upload it again and not much harm will be done.



Step 1: Login to Blogger dashboard and go to Edit HTML page.

Step 2: You must check Expand Widget Templates check box and Find the tag <data:post.body/>


Step 3: Now replace above code with below code

<div expr:id='"aim1" + data:post.id'></div>
<div style="clear:both; margin:10px 0">
<!-- Your AdSense code here -->
</div>
<div expr:id='"aim2" + data:post.id'>
<data:post.body/>
</div>

<script type="text/javascript">
var obj0=document.getElementById("aim1<data:post.id/>");
var obj1=document.getElementById("aim2<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 4: Now note that you must replace <!-- Your AdSense code --> with your Adsense code..

Step 5: In every blog post put a special comment

<!-- adsense -->

in the exact point where you want to your AdSense advertising to be appeared.

Step 6: Save template.