
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>
Comments
Excellent post!keep update more information like this in future.
ReplyDeletePython Training in Chennai
Python Classes in Chennai
JAVA Training in Chennai
Hadoop Training in Chennai
Selenium Training in Chennai
Python Training in Annanagar
Excellent post!keep update more information like this in future.
ReplyDeletePython Training in Chennai
Python Classes in Chennai
JAVA Training in Chennai
Hadoop Training in Chennai
Selenium Training in Chennai
Python Training in Annanagar
Post a Comment