• Translate

12/17/2015

How To Set Up a Blog Widget Only Appear On Certain Parts

Tutorial Blogspot |

Advertisement

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

How To Set Up a Blog Widget Only Appear On Certain Parts
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

How To Set Up a Blog Widget Only Appear On Certain Parts

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)
How To Set Up a Blog Widget Only Appear On Certain Parts
  • 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.
Widget Ramdom Post on template (HTML6)
  • HTML script default, will look like the image below 
HTML6 Script HTML Default
  • Then add the script below
<b:if cond='data:blog.pageType == &quot;item&quot;'>
Widget Code Here
</b:if>
So the result will be like this :
<b:widget id='HTML6' locked='false' title='Random Tutorials' type='HTML'>
    <b:includable id='main'>
<b:if cond='data:blog.pageType == &quot;item&quot;'>
  <!-- only display title if it's non-empty -->
  <b:if cond='data:title != &quot;&quot;'>
    <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.

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.
Disqus
Blogger
How to style text in Disqus comments Top Disqus Commentators
  • To write a bold letter please use <strong></strong> or <b></b>.
  • To write a italic letter please use <em></em> or <i></i>.
  • To write a underline letter please use <u></u>.
  • To write a strikethrought letter please use <strike></strike>.
  • To write HTML code, please use <code></code> or <pre></pre> or <pre><code></code></pre>, and please parse the code in the parser box below.
Show Parser Box

No comments Add Comment

Comments not appropriate topic will sign SPAM.