Last active
October 25, 2022 08:35
-
-
Save vinayprajapati/5893386 to your computer and use it in GitHub Desktop.
Adsense in Middle of Post: Blogger - Advanced Practices (Part 2)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Copyright 2013 by AJ Banda + Vinay Prajapati | |
//http://www.techprevue.com/2013/06/adsense-in-middle-of-post-blogger_30.html | |
//1. Below <head> place this | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js" ></script> | |
//2. Replace <data:post.body/> with the following code | |
<div id="PostBody"> | |
<data:post.body/> | |
</div> | |
<div id="AdCode"> | |
<div style='margin:5px 0;text-align:center;clear:both;'> | |
<!-- Ad Unit Code Here --> | |
</div> | |
</div> | |
//3. Now just before </body> tag paste following js | |
<b:if cond='data:blog.pageType == "item"'> | |
<script> | |
$AdCode = $("#AdCode").html(); | |
$("#PostBody br:lt(1)").replaceWith($AdCode); | |
$("#AdCode").remove(); | |
</script> | |
</b:if> | |
//4. Save template :D | |
It is showing two ads in my post. I just want to show one
You need to use a code of a sync ad, not an async one. It works in my site: https://frenegeek.com
It is showing two ads in my post. I just want to show one
Me too, do you solution show one ads?. i want show in https://choluoi.com
I made a pure Js function similar to this, Check this out: https://github.com/ajaymalik14/place-ad-inside-article-usign-pure-JS
Great, it actually worked for my site: https://tips.vn
Great, I've used it on my website and it works great yalla shoot smart
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It is showing two ads in my post. I just want to show one