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

Thursday, October 28, 2010

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.

0 comments:

Post a Comment

 
 
 

Label

Label

Labels