I am back with blogging ideas that I have personally tried. I believe it helps me in two ways - one by adding one more useful post to my blog and the other is saving it for my future reference just in case if I need it while changing my blog's layout in future.
Explanation of the above code :
<b:if cond='data:blog.pageType == "static_page">
Just place the codes after <b:else/> to make it work.
Hope this solves your needs :). If you got any doubts, kindly drop your question in the comments below so that I may answer.
Related Queries:
As you might have known about AdSense - how to create an AdSense ads both using the HTML widget as well as using parsing adsense feature to insert adsense code into the blog HTML, I am only going to share about on how to make AdSense appear on certain or specific pages.
Why do I need AdSense to appear on specific pages? This is especially needed if you want the AdSense ads to appear below or above the blog posts in a website that has the home page layout is in such a way that nearly 5 to 10 posts are condensed to appear on the front page (like the one I have). As you can see, if I happen to place the AdSense ads inside my blog post, my home page starts to accumulates ads for all the blog-posts and the result is very clumsy. So, I need to figure out a way to keep my home page clean and still make my AdSense appear inside my blog posts.
So, what is the way then? A lot of other websites might have already provided you with some solution. Just in case, you happen to visit this website, then here is my solution
Step 1: Using CTRL+ F , find <data:post.body/> just above the code createSummaryAndThumb("summary<data:post.id/>"); in EDIT HTML of Blogger.
Step 2: Place the following code just below the above code and save
Explanation of the above code :
The code in Step 2 uses if... then ...else conditional tag to check whether the blog's page type is homepage or the others. If it is home page , then the code remains the same. But if it is blog post page or any other page, then AdSense code is displayed.
You can also do the same for making AdSense ads to appear in blog posts pages with specific labels using
<b:if cond='data:blog.searchLabel'>
and for adsense to appear only in static pages by using the code
<b:if cond='data:blog.searchLabel'>
and for adsense to appear only in static pages by using the code
<b:if cond='data:blog.pageType == "static_page">
Just place the codes after <b:else/> to make it work.
In case, if your query is " AdSense ads are appearing only on post pages but NOT on the home page" then look at the above code and do the reversal. So, here you don't need to use the conditional tag. Just make sure you place the AdSense code in the right place following STEP 1.
Hope this solves your needs :). If you got any doubts, kindly drop your question in the comments below so that I may answer.
Related Queries:
For Allan question,
I want to put an ad below my post's titles but I don't want them to appear on the frontpage
Solution: To make your adsense ads to appear ONLY on blog posts and below the blog post title (making sure the ads are not displayed on frontpage), then do the following BEFORE <data:post.body/> code,
<b:if cond='data:blog.pageType == "item"'>
-------your parsed Adsense code here ------
</b:if>
In the above, I am using a conditional tag to make sure that the following adsense code appears if the blog type is equal to item (i.e; blog post) and not homepage.
All tutorials blogged here are from personal experiences with 100% success rate. Enjoy!
I have been searching for a simple solution like this in the Internet. I used the code in my website and it worked successfully. Thank you so much !
ReplyDeleteThank you for dropping by !
DeleteThank you very much! I want to put an ad below my post's titles but I don't want them to appear on the frontpage since it would look dirty and also it wouldn't respect the adsense rules... (Not more than 3 ads per page).
ReplyDeleteHi Allan,
DeleteI have added the answer to your question in the above post itself. Cheers!