Google adsense in the middle of post
Below are steps you can follow to put Google adsense in the middle of your post.
In your template html, find this code: <data :post.body/>
Replace that with the following:
<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>
Save your template to finish.
Now, everytime your write a post, put this code <!– adsense –> in the middle of the post where you want the ad to display.
For More Help Comment Below Post
0 comments:
Post a Comment