Hide Google Adsense Ads In Home Page And Display Them Inside Post Page

Monday, December 06, 2010

  1. Log in to Adsense
  2. Generate code required for displaying appropriate ads on you blog and paste it to a notepad
  3. After pasting the code to the notepad, remove the line breaks and comments from the Adsense code. Make sure that you code looks like the following (do not to modify any script of Adsense, just remove the line breaks and comments alone)

  1. Your Adsense code is ready now. Lets modify blogger template
  2. Log in to your blogger account select Layout of the blog which you want to modify
  3. Navigate through Template --> Edit HTML
  4. Take backup of your template by clicking Download Full Template. This backup will help you if you want to revert to old template
  5. Select Expand Widget Templates option to get access to the full code of the template
  6. Search for   <data:post.body/>    in the template HTML and place the following before the <data:post.body/>
<b:if cond ='data:blog.pageType == "item"'>
<!-- Paste your adsense code prepared in step 3 here -->
</b:if>
  1. Replace the text <!-- Paste your adsense code prepared in step 3 here --> with the adsense code which you prepared in the step 3 using notepad.
  2. After completing the replace operation, code in your template should look similar to the following

<b:if cond='data:blog.pageType == "item"'> 
   <script type="text/javascript">google_ad_client = "pub-asdfsadff";google_ad_slot = "123123123";google_ad_width = 336;google_ad_height = 280;</script> 
<script type="text/javascript" src="http://whatever url showing"> </script> 
</b:if> 
<data:post.body/>
  1. Save the template by clicking on Save Template button
  2. That's all. Your Blogger template is configured to display ads only in the post pages

Troubleshooting Guide

Why Ads are not displayed?
This happens if you modify any attributes of Google Adsense ads by mistake while removing the comments and line breaks.  To solve the problem, get the Adsense code again from Google Adsense and remove the line breaks and comments carefully.

Why Ads are displayed in a table with borders around them?
This happens when the line breaks and comments are not replaced from the Adsense code pasted in Blogger Template. Remove all the line breaks and comment start tags and end tags to solve the problem.
If you face any other problems, please post a comment. Just comment here and I will help you to solve the problem.

You can follow us on Twitter or Join us on Facebook to receive all updates . . .




Share your views...

0 Respones to "Hide Google Adsense Ads In Home Page And Display Them Inside Post Page"

Post a Comment

 

Connect with us

Followers

© 2010 - 2011 theinfoW.com All Rights Reserved | Contact Us | About Us | Privacy Policy | Terms of Use |