BTemplates Blog

Tutorials, documentation and news about Blogger.

QuickT :: How to show only labels with more than X posts!

1. Go to Layout> Edit HTML and do NOT check the “Expand widget templates” box:

2. Look for this line of code:

<b:widget id='Label1' locked='false' title='Labels' type='Label'/>

3. Replace it with the following code:


<b:widget id='Label1' locked='false' title='Labels' type='Label'>
<b:includable id='main'>
<b:if cond='data:title'>
  <h2><data:title/></h2>
</b:if>
<div class='widget-content'>
<ul>
<b:loop values='data:labels' var='label'>
    <b:if cond='data:label.count &gt; 2'>
    <li>
      <b:if cond='data:blog.url == data:label.url'>
        <data:label.name/>
      <b:else/>
        <a expr:href='data:label.url'>
          <data:label.name/>
        </a>
      </b:if>
      (<data:label.count/>)
    </li>
   </b:if>
</b:loop>
</ul>
  <b:include name='quickedit'/>
</div>
</b:includable>
</b:widget>

4. In the first line highlighted in red, you decide the minimum number of posts a label needs to have in order to be displayed in your Labels’ widget/gadget.

🙂

2 Questions and comments on QuickT :: How to show only labels with more than X posts!

RL March 12, 2011 at 5:04 pm

Great, I used this tip on my blog and was very good, thanks.

WW November 14, 2012 at 7:13 am

hey! Let’s say a post has 2 labels, can we say to blogger, to show up on the footer, only the one label, and specify which one of the two?

Leave a Reply