How To Set Up a Blog Widget Only Appear On Certain Parts | I created this tutorial is intended as a reminder to me how to make a blog widget appears only in certain parts, for example on the front page of the blog, random post widget does not show, but on a page posting random post widget will appear. This way not only for random post widget, but can be used for other existing widget on your blog.
Follow the steps below so that you understand how to create a blog widget appears only in certain parts, for example, I took random post widget to appear on post pages just as I apply my blog. below is a screenshot of the main page of my blog
as seen in the picture above, random post widget does not appear on the main page of my blog, because the random post widget will only appear if you read the tutorial that is posted on my blog posts. please see screen shoot below
Well, how do I make to be like the example image above? it turns out is very easy, just insert some code only. follow the steps below :
- Log into your blogger layout
- see url random post widget (on my blog, random post widget url link shows HTML6)
- Click the template, then edit html and find the code that has been copied by using Ctrl + F
- In the image below, the code is still not fully appear, so to display click the dots.
- HTML script default, will look like the image below
- Then add the script below
<b:if cond='data:blog.pageType == "item"'>So the result will be like this :
Widget Code Here
</b:if>
<b:widget id='HTML6' locked='false' title='Random Tutorials' type='HTML'>
<b:includable id='main'>
<b:if cond='data:blog.pageType == "item"'>
<!-- only display title if it's non-empty -->
<b:if cond='data:title != ""'>
<h2 class='title'><data:title/></h2>
</b:if>
<div class='widget-content'>
<data:content/>
</div>
</b:if></b:includable>
</b:widget>
- Please save it.
Well, those of you who want to display the widget only on the main page. the same way, only just a different code. The following script which must be added if you want to display the widget only on the main page.
<b:if cond='data:blog.url == data:blog.homepageUrl'>Widget Code Here</b:if>
Done, please try your own way over and hopefully this post will help you. Thank you for your visit and do not forget to share it.
Found an article helpful? Donate via Paypal
Disclaimer: Images, Content of articles or videos that exist on the web sometimes come from various sources of other media. Copyright is fully owned by the source. If there is a problem with this matter, you can contact us here.
<strong></strong>
or<b></b>
.<em></em>
or<i></i>
.<u></u>
.<strike></strike>
.<code></code>
or<pre></pre>
or<pre><code></code></pre>
, and please parse the code in the parser box below.