Advanced Search Module

Close Search

Show Labels containing specific number of Posts

I have already written ” How to show only specific number of posts on Labels Page “. Today I am going to tell How to Show Only Labels with specific number of posts. This hack is very useful for those who have plenty of Labels in their Blog. It’s a very simple hack , just follow the below steps to implement this hack in your blog.

Step 1 : Login to your Blogger Account and go to Layout section of your Blog.

If you don’t have any Labels widget then add it by clicking ADD Page ELEMENT link in the Page. Then navigate to EDIT HTML subtab and Check EXPAND WIDGETS box.

Step 2 :

Now search for this Line.

<b:widget id=’Label1′ locked=’false’ title=’Labels’ type=’Label’>

Now below this line , you will find this code

<b:loop values=’data:labels’ var=’label’>
<b:if cond=’data:blog.url == data:label.url’>
<a expr:href=’data:label.url’><></a>

Now replace the above code with the following code.

<script type=’text/javascript’>
var labelnum = 0;
<b:loop values=’data:labels’ var=’label’>
if (<data:label.count/> &gt; 2) {
document.write(&quot;<li><a expr:href=’data:label.url + “?max-results=5“‘

It should look like this

Show only Labels with specific number of posts

In the above script edit the text in green to show Labels which contains more than text in Green.

for example : I have chosen number 2 , then Labels which contains more than 2 posts will be shown and other labels will be hidden.

Edit the text in red to show only specific number of posts in Labels Page.

That’s it , you have successfully implemented the “Show Labels with specific number of Posts ” hack in your blog.

If you have any problem , let me know.

Related posts:

  1. Show only specific Number of posts in Labels Page – Blogger Hack
  2. Related Posts Widget For Blogger – Bugs fixed
  3. Show Date before each Post in Blogger
  4. Related Posts Widget For Blogger with CSS
  5. Add Yahoo Smileys to Blogger Posts – Firefox Hack

12 Responses to “Show Labels containing specific number of Posts”

  • Mishef August 25, 20084:38 pm

    This is not work for me!
    This is my code for Labels —>

    Please mail me if u know what to do to fix for me. My email is

    Thanks a lot.

  • ????? ???????? August 25, 20085:55 pm

    wow rias,

    Today, I requested for this….and you posted same thing.. you are great.. I will see this hack and will respond you…


    I also mailed you my template, please do that was i requested

  • ????? August 25, 200810:36 pm


  • picsfun12 August 31, 20087:04 pm

    Hey ur posts are so cool and code display is very awesome!
    Thank you :)

  • John September 1, 20083:43 pm

    Thanks a lot, though I would prefer to being able to filter out some labels in the sidebar (as they are already in the menubar) this is a relatively good workaround. Or should I say: best one found so far :) Thanks again Mohamed.

  • November 12, 20089:32 pm

    Thanks a lot

  • Steve Oldner December 18, 200812:55 am

    Nice layout! Good info! I subscribed.

  • "Patrick Bateman" January 10, 200910:28 pm

    0 for 2 on your reco’s … Get this error


  • Samir January 23, 20099:25 am

    not working

  • Xtreme_Blogger February 9, 20091:49 pm

    Gr8 share thanx

  • David Bergeron May 15, 20099:27 am

    Thanks, works good. Is it possible to show specific number of posts on achieve pages?

  • Nuntal May 21, 200910:13 pm

    Not working for me!


12 Responses to "Show Labels containing specific number of Posts"