In this
procedures would only work while we place the ads on prearranged and fixed
locations. For posts area, the most mutual places are below the title, at the
beginning of the post or at the end of the post.
But
what if we want to show an AdSense ad in the middle of a post?
We can influence the position of the ads to be exhibited by adding a script inside the template, then using a label inside our post to where we want the AdSense ad to appear. Once added, we can place the ads anywhere, be it between paragraphs or in the middle of the content etc.
Before proceeding, it is recommended do backup your template (go to Template > click on the Backup/restore button)
Step 1. First thing we need to do is to "parse" the AdSense code, in other words, convert it to plain text. Then go to Template, click on the Edit HTML button, click anywhere inside the code area and look for this tag (CTRL + F):
We can influence the position of the ads to be exhibited by adding a script inside the template, then using a label inside our post to where we want the AdSense ad to appear. Once added, we can place the ads anywhere, be it between paragraphs or in the middle of the content etc.
Before proceeding, it is recommended do backup your template (go to Template > click on the Backup/restore button)
Step 1. First thing we need to do is to "parse" the AdSense code, in other words, convert it to plain text. Then go to Template, click on the Edit HTML button, click anywhere inside the code area and look for this tag (CTRL + F):
<data:post.body/>
Note: you may find it
several times, but we need to stop at the second one or if you can't see any
changes, test the third one
Step 2. Replace
the <data:post.body/> tag with this code:
<div expr:id='"adsmiddle1" + data:post.id'></div><div style="clear:both; margin:10px 0"><!-- Add here the code of your ad --></div><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. Put the
converted AdSense code to where you see the <!--
Add here the code of your ad --> annotation, then save the changes by
clicking on the Save template button
Step 4. When you create a New Post, add this tag inside the HTML section in the exact location where you want the Google AdSense ads to appear:
Step 4. When you create a New Post, add this tag inside the HTML section in the exact location where you want the Google AdSense ads to appear:
<!-- adsense -->
For example:
<div>This is a demo text. This is a demo text. This is
a demo text. This is a demo text. This is a demo text. This is a demo text.
This is a demo text. This is a demo text. This is a demo text. This is a demo
text.</div>
<!-- adsense --><div>This is a demo text. This is a demo text. This is a demo text. This is a demo text. This is a demo text. This is a demo text. This is a demo text. This is a demo text. This is a demo text. This is a demo text.</div>
Note: If you don't add the label to bring up the ads then
the ad appears below the title by default.
This method doesn't violate Google's Terms of Service because you are not changing the structure of the ad.
This method doesn't violate Google's Terms of Service because you are not changing the structure of the ad.
i hope this tutorial is helpful for youDon't forget to give your feedback in below comments...
0 comments:
Post a Comment
Speak Your Mind. . . ! ! !