Saturday, September 07, 2013

Adsense in the Middle of the Post

Tags

Adsense in the Middle of the Post
This tricks applied for Blogger

1. Login -> Template -> Edit HTML
2. Find the code <head>
3. Put the below code after the code number 2
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js' type='text/javascript'/>

Note: there's no need to put the above code if jQuery code is already in place in your template.

4. Put the following code below <head> as well:

<script type='text/javascript'>
$(document).ready(function(){

$(&#39;a[name=&quot;more&quot;]&#39;).before($(&#39;#MBT-google-ad&#39;).html());
$(&#39;#MBT-google-ad&#39;).html(&#39;&#39;);

});
</script>

5. Find out this code <data:post.body/>
6. Put the following code after the code number 5
<b:if cond='data:blog.pageType == &quot;item&quot;'>
<div style="display:none;">
<div id='MBT-google-ad'>
<br/>
<center>
ADSENSE CODE HERE </center>
<br/>
</div>
</div>
</b:if>

7. Change the "ADSENSE CODE HERE" with your real Adsense code (you should encode it first).
8. Save template. Done.

Credit for this hack: mybloggertricks.com/2013/02/positioning-adsense-ads.html