Latest Articles
Loading...

Info Post
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.

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(&quot;summary<data:post.id/>&quot;);  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.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 == &quot;item&quot;'>
 -------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!

4 comments:

  1. 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 !

    ReplyDelete
  2. Thank 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).

    ReplyDelete
    Replies
    1. Hi Allan,
      I have added the answer to your question in the above post itself. Cheers!

      Delete

Thank You for visiting Momscribe.com !
Your contribution is greatly appreciated.
Please feel free to subscribe to this blog either by Email or any methods listed on the right side of this content.

நன்றி ! மீண்டும் வருகை தாருங்கள் :)