This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. By using this website you also agree to our FTC Disclosure, Privacy Policies, Copyright Notice, and other Terms and Conditions"

Proudly Powered By Blogger
Completely Unique Theme Development
Designed with by ™ SHIBLI N.



Think Globally, But Act Locally

WorkStation247 | Creative Resources

StartUp Digital Entrepreneur's Creative Converting Resources

25 May 2016

How To Show or Hide Widgets or Sections In Blogger

When you create a blog, you may want to show some widgets in some pages, and some widgets will display on the specified page. Also, such a widget is necessary for AdSense ads to display on some pages or not. In such a situation, you have to add some code for any specific widget or section. Here I will present both topics in today's post. For bloggers such as show or hide widgets on specific pages, it will also apply to home pages, post pages, static pages, archive pages and even on posts, etc.

In Blogger, to show or hide the widget or section on specific pages, you need to add a conditional statement in the code format, and you need to add this code inside that particular widget code in the blogger templates code area. Which is a straightforward and easy task to do, so that you can take some time to understand it.

How To Show or Hide Widgets On Specific Page?

STEP 01:
First of all, find out the code of that specific widget that will show or hide.


Notice that the code for a widget on your blog is such:

<b:widget id= 'HTML11' locked='false' title='Popular posts' type='HTML'>
  <b:includable id='main'>

    < ------ all widget code ------- >

  </b:includable>
</b:widget>

Now, after adding the following code for Show or Hide, all the code will look like:

<b:widget id= 'HTML11' locked='false' title='Popular posts' type='HTML'>
   <b:includable id='main'>
   <b:if cond='data:blog.pageType == data:blog.homepageUrl'>

   < ------ all widget code ------- >

   </b:if>
  </b:includable>
</b:widget>

That Is To Say,
Add the following conditional code just below <b:includable id = 'main'> 
and just above </ b: includable>

How To Show or Hide Sections On Specific Pages?

Almost the same subject to show or hide blogger section because in this case, the following mentioned conditional codes will be required. But the type of usage will be a little different to show or hide any section in blogger.

For example:

<b:if cond='data:blog.url == data:blog.homepageUrl'>
Displays widgets/sections/styles between this tags only on homepage
</b:if> 

That is, the beginning of the conditional code and end of the conditional code will be subject to the conditional code type.

<b:if cond='data:blog.url == data:blog.homepageUrl'>

Thus, this section can contain any code, widgets/sections/styles, which will not show on the homepage

</b:if> 

Please see the picture to understand more details

All The Conditional Statement To Show or Hide In Blogger

To Show Blogger Widget only in Homepage

<b:if cond='data:blog.pageType == data:blog.homepageUrl'>
</b:if>

To Hide Blogger Widget only in Homepage

<b:if cond='data:blog.pageType != data:blog.homepageUrl'>
</b:if>

To Show a Widget only in Post Pages

<b:if cond='data:blog.pageType == "item"'>
</b:if>

To Hide a Widget only in Post Pages

<b:if cond='data:blog.pageType != "item"'>
</b:if>

To Show a Widget only in Static Pages

<b:if cond='data:blog.pageType == "static_page"'>
</b:if>

To Hide a Widget only in Static Pages

<b:if cond='data:blog.pageType != "static_page"'>
</b:if>

To Show a Widget only in Archive Pages

<b:if cond='data:blog.pageType == "archive"'>
</b:if>

To hide a Widget only in Archive Pages

<b:if cond='data:blog.pageType != "archive"'>
</b:if>

To Show a Widget only in a Specific Page or post

<b:if cond='data:blog.pageType == "URL of the page or post"'>
</b:if>
All of the above codes will be required many times in your blogging life, so copy them somewhere or don't forget to bookmark this page.

At The End

Hopefully, you understand how to make how to show or hide widgets or sections in Blogger. If there is a complexity, then you can write down the comment box below. Happy Blogging!
How To Show or Hide Widgets or Sections In Blogger
4/ 5 stars - "How To Show or Hide Widgets or Sections In Blogger" When you create a blog, you may want to show some widgets in some pages, and some widgets will display on the specified page. Also, such a...

No comments:

Post a Comment


Recent Comments

Theme Design Secrets



" No matter how many times you made mistakes
or how slow you progressed
you are still way ahead of everyone
who are not trying"



Unlock
Blogger Theme Design Secrets
Learn Form The Basic
[ ] hover over to see secrets



Soon to be revealedy

In progress 'Wait for it...' ;)







About Services

Video Editing, Graphic Design, Custom Template Design, service is currently not available due to excessive demand. We expect to accept new orders from March 1st, 2019.
Exclusively on Fiverr
Thank you for your understanding.



And this is what i do
UNLOCK

$('.comment-content a[rel$=nofollow]').replaceWith(function(){return ($(this).text());});