USEFUL TOPICS AND OTHER RELATED TOPICS

show ads at the start and end of posts blogger

 100 % working - can't afford demo
To show adsense and other ad codes in either of the sidebars or footers or easy but to get visitors attraction these codes must be also in the content area of your (i,e) the post section. Here we are about to see how to put ads not only at the top and bottom of the post but also in the middle of the posts.

Step 1:  save the template and just expand widgets and search for <data:post.body/> and paste the code right above and below the code as shown below




<!-- adsense or anyother ad code -->

<data:post.body/>

<!-- adsense or anyother ad code-->

Step 2:  To display ads between each posts , again search for <data:post.body/>

and paste these codes along with your ad code

<div expr:id='"aim1" + data:post.id'></div>
<div style="clear:both; margin:10px 0">
<!-- adsense or anyother ad code-->
</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>

Remember, before you paste your adcode in edit html section please make sure that you have changed these </> into &lt; and &gt;

THATS IT.....

0 comments:

Post a Comment

Have anything to say? dont spam please..