how to add Adsense code in below post title Middle, after 1st paragraph in blogger Sidebar and the mobile template too.
1 AdSense code in below post title in blogger
- Find <data:post.body/> in your template
- Paste Adsense above it without parsing see below
- There are 3 <data:post.body/> tags generally 2nd works. if you enable search description then automatically other one works.
- if you confused just reply I will back with you within minutes.
The normal themes above 2nd <data:post.body/>
works OK.
its working find this <div class=’post-body entry-content’ expr:id=’"post-body-" + data:post.id’ itemprop=’description articleBody’>
below it
or
<data:post.body/> 2nd above it
TIP if you confused to find correct <data:post.body/> among 3. you can put a symbol before the <data:post.body/> like 1 for 1st line, 2 for 2nd one, 3 for 3rd one. save template. visit your website and check which number appearing in below post title in blogger. simply replace that with your adsense code.
paste the ad code below also you want right or left central use div id float left
<div id=”leftFloat“>A left-floated div</div> <div id=”rightFloat“> for center simply put this codes <center> adsense code </center> or simply you want place left use this <div align=’left’>
<div style=’float:left;’>
<script type=’text/javascript’> //<![CDATA[ Adsense code without parsing //]]>
2. Insert Adsense Ad middle of the blogger post.
NOTE: If you enable Custom Search Blog description Then <data.post body/> turns to next adsense ads not appears for this again you have to test which data post body tags works for you generally without custom description 2nd one works for custom search description 3rd works in blogger. this credit was goes to imranuddin who was made it request of someone one may be me.
Step: 1Find <data:post.body/> 2nd or 3rd and replace with this.
Step 2:<div id=’jobmiddlenew’>
<data:post.body/>
</div>
<b:if cond=’data:blog.pageType == "item"’>
<style>
#addcodemiddle{display: none;}
</style>
<div id=’addcodemiddle’>
<script type=’text/javascript’> //<![CDATA[ Place Your Ad Code Here without parsing //]]>
</div>
<script type=’text/javascript’>
var str1=document.getElementById("jobmiddlenew").innerHTML;
var str2=str1.length;
var str3=str2/2;
var substr = str1.substring(str3, str2);
var n = substr.search("<br>");
if(n<0)
{
n = substr.indexOf(‘.’);
if(n<0)
{
n=0;
}
var firsthalf = str1.substring(0, str3+n+1);
var secondhalf = str1.substring(str3+n+1, str2);
}
else
{
var firsthalf = str1.substring(0, str3+n+4);
var secondhalf = str1.substring(str3+n+4, str2);
}
var addcode="<center>"+document.getElementById("addcodemiddle").innerHTML+"</center><br/>";
var newbody=firsthalf+addcode+secondhalf;
var strnew=document.getElementsByClassName("post-body entry-content");
strnew[0].innerHTML=newbody;
document.getElementById("addcodemiddle").innerHTML="";
</script>
</b:if>
3. Add Adsense ad After 1st /2nd paragraph In blogger
Step I,Find <data:post.body/>
STEP 2: Replace with
<b:if cond=’data:blog.pageType == "item"’>
<div id=’adsense-content’ style=”display:block;text-align: center”><script type=’text/javascript’> //<![CDATA[ Place Your Ad Code Here without parsing //]]></div></b:if><div id=’adsense-target’><data:post.body/></div><script type=’text/javascript’>
function insertAfter(addition,target) {
var parent = target.parentNode;
if (parent.lastChild == target) {
parent.appendChild(addition);
} else {
parent.insertBefore(addition,target.nextSibling);
}
}
var adscont = document.getElementById("adsense-content");
var target = document.getElementById("adsense-target");
var linebreak = target.getElementsByTagName("br");
if (linebreak.length > 0){
insertAfter(adscont,linebreak[0]);
}
</script>
Step 3 Customization Center/ left /right
5. how to add Adsense ad below Below post content in blogger
The easy way to you can add it by Editing blog Posts widget in blogger layout and check Display Adsense ads between the Number of posts, you can select responsive add also from there.
f you want to add a text unit that’s not possible, All you have to do just place ad code after <data:post.body/>(ad code goes here) align it t center.
How enable Ads in Blogger Mobile Template?
Is parsing Adsense code legal / illegal / against google AdSense policies?
Maybe, illegal if your time bad. Modifying adsense code against in adsense policies that leads to display more than 3 ads per page. waste of time thinking about that.
what happens if you parsed the Adsense code?
how to add Adsense code to without parsing?
<script type=’text/javascript’>
//<![CDATA[
… Adsense code …
//]]>
</script>
Ask a Question:
You must be logged in to post a comment.