Sunday, 27 September 2020

How To Show Widget Only On Certain Pages 2020

How To Show Widget Only On Certain Pages 2020

How To Show Widget Only On Certain Pages 2020
Sunday, 27 September 2020


Displaying a widget on a certain page is of course an advantage for the blog. For example, we install a related article widget that is only on the posting page, of course the widget that you install on the posting page will provide a choice of other articles, besides that it will be more effective at saving your blog's homepage space.
If you want to try to apply it on your blog, I will share tips for displaying widgets on certain pages. Just curious, just follow the tips below.

How To Show Widget Only On Certain Pages

1. The widget appears only on the front page (homepage)

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

2. The widget appears on all pages except the homepage.
<b: if cond = 'data: blog.url! = data: blog.homepageUrl'>
.................................................. ....
</ b: if>

3. The widget appears on the Archive page only.
<b: if cond = 'data: blog.pageType == & quot; archive & quot;'>
.................................................. ....
</ b: if>

4. Widget appears on all pages except archive pages.
<b: if cond = 'data: blog.pageType! = & quot; archive & quot;'>
.................................................. ....
</ b: if>

5.Widget appears only on post pages.
<b: if cond = 'data: blog.pageType == & quot; item & quot;'>
.................................................. ....
</ b: if>

6. Widget appears on all pages, except post pages.
<b: if cond = 'data: blog.pageType! = & quot; item & quot;'>
.................................................. ....
</ b: if>

7. Widget appears only in certain posts.
<b: if cond = 'data: blog.pageType == & quot; post-address & quot;'>
.................................................. ....
</ b: if>

8. Widget appears other than in certain posts.
<b: if cond = 'data: blog.pageType! = & quot; post-address & quot;'>
.................................................. ....
</ b: if>

9. Widgets appear only on staticpages pages.
<b: if cond = 'data: blog.pageType == & quot; static_page & quot;'>
.................................................. ....
</ b: if>

10. Widgets appear on all pages, except staticpages pages.
<b: if cond = 'data: blog.pageType! = & quot; static_page & quot;'>
.................................................. ....
</ b: if>
Note: For the dots above is the widget code that must be placed

How to install widgets on certain pages

1. Login to Blogger .
2. Go to Tempalte > Edit HTML
3. Find the widget that you want to hide (make sure you have installed the widget on the blog)
4. Use CTRL + F for easier search.
5. For example I use the latest articles which only appear in blog posts.
<b: widget id = 'HTML2' locked = 'false' title = ' Latest articles ' type = 'HTML' version = '1' visible = 'true'>
<b: includable id = 'main'>
<! - only display title if it's non-empty ->
<b: if cond = 'data: title! = & quot; & quot;'>
<h3 class = 'title'> <data: title /> </h3>
</ b: if>
<div class = 'widget-content'>
<data: content />
</div>
</ b: includable>
</ b: widget>.

6. Next add the code according to the needs of your blog.
For example, post the code below
<b: if cond = 'data: blog.url! = data: blog.homepageUrl'>
before the code
<! - only display title if it's non-empty ->

7. Then add the </ b: if> code before the code
</ b: includable>
</ b: widget>

8. If you installed correctly then the result is as below.
<b: widget id = 'HTML2' locked = 'false' title = ' Latest articles ' type = 'HTML' version = '1' visible = 'true'>
<b: includable id = 'main'> <b: if cond = 'data: blog.url! = data: blog.homepageUrl'>
<! - only display title if it's non-empty ->
<b: if cond = 'data: title! = & quot; & quot;'>
<h3 class = 'title'> <data: title /> </h3>
</ b: if>
<div class = 'widget-content'>
<data: content />
</div>
</ b: if> </ b: includable>
</ b: widget>
Description: The code in blue is the code that is added. Make no mistake in placing it.
Thus the discussion of the article on How to Display Widgets Only on Certain Pages, hopefully this is useful for you and beautify the appearance of your blog. If there are suggestions and criticisms, please just comment in the comments section. Thanks for visiting my blog.
How To Show Widget Only On Certain Pages 2020
4/ 5
Oleh

Comments