Friday, November 6, 2015

Hide and Show Blogger Widgets in Specific Pages of Blogger

Blogger widgets are shown all of the pages of blogger blog in default when you add widgets in your blogger. But this may cause bad looks of your blogs. If you want a smart blog which has all the features not repeating more than once, you should learn to show or hide blogger widget in particular pages that you want to.

You can apply a conditional tag which helps you to show or hide any widget in specific pages. Basically, bloggers try this method to make their design looks better and they also apply this method to make blogger design adsense friendly. If you are adsenser, you must know adsense allows 3 ads placement in a page. So that if you put 3 ads through widget then it will be seen in all the pages as same. However, you can apply show hide widget that help you to place adsense ads in different style in different pages.

Particularly, there are 4 styles pages in blogger and they are post page, home page, archive or label pages and static page. Therefor, you can apply this hide and show technique only on these pages.

In the below steps, we used advertisement widget to show and hide in specific pages of blogger.

How to hide and show blogger widget in blogger post pages?

Only show advertisement in post pages

Only hide advertisement widget in post pages
As shown in the above pictures, you have to add a conditional code after find widget that you want to hide or show in post pages, Use <b:if cond = 'data:blog.pageType = = " item "'> to show widget only in post pages and use <b:if cond = 'data:blog.pageType ! = " item "'> to hide widget only in post pages.

How to show and hide widget in homepage of blogger blog?

Show advertisement widget only in homepage
As shown in above picture, you have to add <b:if cond = 'data:blog.url = = data:blog.homepageUrl '> code in a widget which you want to show in home page only. 

And to hide a particular widget from homepage, you just add <b:if cond = 'data:blog.url ! = data:blog.homepageUrl '> code. Hope, this may help you to hide and show adsense in homepage of blogger also.

How to show and hide widget in static pages?

Now it is also easy to show widget only in blogger static pages. To apply this process you have to add <b:if cond = 'data:blog.pageType = = " static_page "'> code as shown in below figure. Here we used to show advertisement widget in static pages.
Show advertisement widget only in static page
Likewise you must put <b:if cond = 'data:blog.pageType ! = " static_page "'> code to hide advertisement widget from all static pages.

How to show and hide widget in label pages of blogger?
Likewise the above codes, or figure, we use <b:if cond = 'data:blog.pageType = = "archive"'> code to show particular widget in all blogger label pages which is also called archive page. And just use <b:if cond = ' data:blog.pageType ! = "archive"'> to hide widget from all archive pages. 

I hope, this can help you guys to keep looks of your blogger template much better. 
0

0 comments:

Post a Comment