We all use widgets to make our blog reader friendly, to increase our conversion rate and so on.

But once we put them on the blog they appear on every single page of your blog.

Which includes the Homepage,static pages ,post pages and everything that comes under your blog.

Doesn't matters if you want them to appear everywhere or not they will be there.

So today, in this post I'm going to blog about How you can get this problem solved and get your widgets placed according to your choice.


Why Show or Hide Widgets On the Blog ?


So what's there in making widgets show or hide on different pages ?

It can be useful in quite a few ways e.g : it can get you more subscribers or in other words can boost your conversion rate up.

Many bloggers use about me widgets or testimonials on their sidebar to let their readers know who they are.Maybe you use them too, Right?

And your blog would have a About me page too.

Now probably you knew the fact that an About me page gets the most visits in a blog.

Because the readers are always curious about the creater of the blog and that is just why they can't stop their selves to check out who you are.

Now since we know the fact that the About me page gets quite a lot of visits.We can turn this page to subscriber generating machine.

Only if you have placed the right things in the right place on the Page.

So if you have an About me widget on the sidebar you don't want it to appear on your About me page because the user is already reading about you on the page.

Instead of the About me widget you can put a Subscription box in the sidebar so that it gets the maximum attention of the user and as a result there are better chances of converting a new visitor into an subscriber.

How to Hide or Show Widgets :

You can check almost all of the widgets that you have in your blog in the layout section.

Just go to blogger dashboard and select your blog and navigate to the layout section.What you need to figure out is the name of the widget you wish to show or hide.You are going to need the name later so keep it mind or simply copy it.

As here I have choosed to customize the Page Gadget just for the sake of this tutorial.














Now after choosing the widget you wish to customize.Head towards the template section.Click edit template and then press Ctrl + f to get the search bar and then search the name of the widget until you get something like the code given below.

 <b:widget id='PageList1' locked='false' title='Pages' type='PageList'>
    <b:includable id='main'>
  <b:if cond='data:title'><h2><data:title/></h2></b:if>
  <div class='widget-content'>
    <b:if cond='data:mobile'>
      <select expr:id='data:widget.instanceId + &quot;_select&quot;'>
        <b:loop values='data:links' var='link'>
          <b:if cond='data:link.isCurrentPage'>
            <option expr:value='data:link.href' selected='selected'><data:link.title/></option>
          <b:else/>
            <option expr:value='data:link.href'><data:link.title/></option>
          </b:if>
        </b:loop>
      </select>
      <span class='pagelist-arrow'>&amp;#9660;</span>

     <b:else/>

      <ul>
        <b:loop values='data:links' var='link'>
          <b:if cond='data:link.isCurrentPage'>
            <li class='selected'><a expr:href='data:link.href'><data:link.title/></a></li>
          <b:else/>
            <li><a expr:href='data:link.href'><data:link.title/></a></li>
          </b:if>
        </b:loop>
      </ul>
    </b:if>
    <b:include name='quickedit'/>
  </div>
</b:includable>

  </b:widget>

Got the tags in red ? OK so we need to put some piece of code between those red tags in order to show or hide them on particular pages.

Note :
           In this tutorial I was customizing the widget 'Pages' so I searched for the title Pages in my template.Make sure you search the title of the widget you want to customize and make changes in the correct place.

Show Widget in Homepage and Other Pages ( except Post Pages) :

Now to make the widget appear on Homepage and Other pages except Post pages just insert this piece of code just below <b:includable id='main'>  

<b:if cond='data:blog.pageType == &quot;index&quot;'>

and this code just above </b:includable>

</b:if>

Show Widget in Post pages only :

To show a widget on Post pages only insert this piece of code just below <b:includable id='main'>

<b:if cond='data:blog.pageType == &quot;item&quot;'>

and this code above </b:includable>.

</b:if>

Show Widget On a Particular Page Only :

To make the widget appear only in a particular page you need to place this piece of code just below <b:includable id='main'> 

<b:if cond='data:blog.url == &quot;URL of the page&quot;'>

Just put a link of the page on which you want the gadget to appear.

and this code above </b:includable>.

</b:if>

How to Hide a Widget On a Specific Page :

Now the process of hiding a widget is much more simple.All you need to do is to choose one of the codes I have given above and add an exclamation mark just before the "=" (equals) sign.

The only difference in this code will be that it will have only one equal sign where the others had two of them.

Take a look on the tag given below.It will hide widget in post pages only :

<b:if cond='data:blog.pageType  != &quot;item&quot;'> </b:if>
And that's it your done.Load the pages on your blog you wished to customize and enjoy the changes.

Share Your Views :
         That was all required to get your widgets placed according to your ease. I tried hard to describe things the best and simple way possible but still if there is something that needs to be discussed on this topic, make sure you leave it down in the comment box below.


Was the content worth a share?

No comments:

Post a Comment

Translate

Follow via: