Master Code That Displays Adsense Ads Below Post Title, Middle Of Post and Below Post In Emporio Blogger Theme

Here is the master code you need to display any advert including Google Adsense ads

  • below the blog post title,
  • in the middle of blog post and
  • below blog post

if you are using the Emporio Blogger theme.

It is the exact code I use to implement Google ads in my blog posts at Ogbongeblog, when the blog was still on Blogger platform.

Sign in to your Blogger dashboard, navigate to “theme” > “edit theme”, find and replace <data:post.body/> with the code below.

<br>
<div id='adsense-block' style='display:block;text-align: center'>
PASTE CODE OF ADSENSE AD THAT WILL DISPLAY UNDER POST TITLE HERE
    </div></br>
<div id='adsense-content' style='display:block;margin-bottom:15px;margin-top:15px;text-align: center'>
PASTE CODE OF ADSENSE THAT WILL DISPLAY IN MIDDLE HERE
</div>
   <br><div id='adsense-target'><data:post.body/></div></br>
<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(&quot;adsense-content&quot;);
var target = document.getElementById(&quot;adsense-target&quot;);
var linebreak = target.getElementsByTagName(&quot;br&quot;);
if (linebreak.length &gt; 0){
insertAfter(adscont,linebreak[2]);
}
</script>
<br><b:if cond='data:blog.pageType == &quot;item&quot;'>
<div id='adsense-content2' style='display:block;text-align: center'>
PASTE CODE OF ADSENSE THAT WILL DISPLAY BELOW BLOG POST HERE
                      </div></b:if></br>

Parse your adsense codes here and place them accordingly in the code above and SAVE.

That’s all.

5 Likes

Baba for the code… It makes sense…

Finally Oga @jidetheblogger have shared the code. If I don’t sharethis post, I’ll not be happy with myself.

1 Like

@jidetheblogger this is very useful. I am now asking for the permission to allow me publish this post on my blog with backlink. May I??

@jidetheblogger I tested the code on some emporio blogs and discovered that in-article ads don’t display on mobile middle on post but web only…But I remove the code and use another, the in-article ad show on mobile post middle…

but this is what i use and it shows since emporio is responsive and doesn’t require different placement for desktop and mobile views. they might have to adjust the paragraph settings in the code though esp if the blog post is just some few words.

or do you mean it shows normal ad instead of inarticle ads?

If you add normal ad unit code, it displays show in the middle of the post but if in-article ad unit is added, it doesnt show on mobile. Another thing is that is it doesnt show in opera mini irrespective of where you place the code.

This is it showing on mobile.

This emporio is gradually gaining rounds, seems I’ll also switch

Lol, what are you waiting for???

Share the code you use…

[04/01, 9:10 a.m.] afoinfoblog.com: I noticed that the middle ads is around second paragraph [04/01, 9:10 a.m.] afoinfoblog.com: Can I change it to third paragraph [04/01, 9:10 a.m.] afoinfoblog.com: If so, which code do I need to edit

replace the 2 with 3 or 4

lol.

The Mastercode here would makes it Super easy for people who want to insert Google ads on their theme… :smile:

Yes na. That’s the aim of the planet :waxing_gibbous_moon:

i cannot find <data:post.body/> in my blogger html. Why is that?

Is it applicable to all templates?

Are you using a Custom template for your blogger blog?

Not all template..

Some theme especially third party comes with more than 3 <data:post.body/> codes. Hence you’ll need to find the right one to make the changes you need on your site