Searching...
Thursday, 28 February 2013

Display Gadgets on only Home Page, Static Pages, Posts Pages or Index Pages


Display Gadgets on only Home Page, Static Pages, Posts Pages or Index Pages

In this post I will provide a great blogger trick with which you can display the gadgets on your desired address, whether its Blogger Home page or Post pages or Static pages or Index pages or even on any particular post or page.

There can be various reasons for which you may not want to display the gadget on every sub-domain of your blog. Like if you added a LinkWithin widget to your Blog and don't want to display it in Home pages too. Or if you want to display a Welcome Message on the Home Page using HTML/JavaScript Gadget and don't want it to be displayed elsewhere. Or for any other reason then this trick would be of great use to you.


First of all let us learn how to know the Widget ID of the widget that you want to work with.

Note: If you have named your Gadget then you may skip this step. For Some reasons you might have not named your gadget then follow this step.

  • From your Blogger Dashboard go to Layout
  • Click on Edit option of the gadget.
  • The Edit Window of the gadget will pop up. Go to the address bar of this Window.
  • You will find an address similar to this:

http://www.blogger.com/rearrange?blogID=1539913304115984984&action=editWidget&sectionId=sidebar-right-1&widgetType=HTML&widgetId=HTML9

  • So here HTML9 is the Widget ID.

1. Now To Display The Gadget Only On Home Page.
  • From your Blogger Dashboard go to Template.
  • Click on Edit HTML and check the Expand Widget Templates option above.
  • Press Ctrl+F and search your Widget ID (ie HTML9 here) OR search the name of your gadget if your gadget has a name. You will see a section of codes similar to this:

 
 
   

 
 
   
 

 

  • Note: The widget code may vary with respect to the Widget. For example the Follower Widget.
  • Now add two pieces of code given in bold red exactly in the position as you can see in the section of code below:

 
 
   

 
 
   
 

 

  • Make sure you have it added correctly. Then save your template.
  • Note: For more desired customization, in the above code you can change == (equal to operator) to != which means "not equal to".

2. To Display The Gadget Only On Post Pages
  • Follow the same procedure as in displaying the gadget on home page but this time add these two pieces of code given in bold red exactly in the position as you can see in the section of code below:

 
 
   

 
 
   
 

 

  • Make sure you have it added correctly. Then save your template.

3. Similarly To Display Only On Static Pages.
  • Following the same procedure use this piece of codes  in the location as mentioned earlier :


THE HTML CODE GOES HERE BETWEEN THE TAGS

4. To Display On Everything (home page, labels pages, archive pages) Except Post Pages.
  • Following the same procedure use this piece of codes  in the location as mentioned earlier :


THE HTML CODE GOES HERE BETWEEN THE TAGS

5. To Display On Page Of The Specific Post Or Specific Static Page
  • Following the same procedure use this piece of codes in the location as mentioned earlier:


THE HTML CODE GOES HERE BETWEEN THE TAGS

Add these codes exactly in the position as mentioned in the Steps.
You can do this with as many items in your sidebars as you like and with any gadgets, if you need extra help you only need ask in the comments.

0 comments:

Post a Comment