5 Show labels without the post count
Thursday, November 15, 2007 /

Labels are very useful to help categorize your posts, and also so readers can easily find posts they would like to read. The default "labels" widget will also show the post count beside the label name, to inform your readers how many posts are categorized under this label. However, this isn't to everyone's taste, and can also be disheartening when one of your labels only has a small post count beside it! So if you would prefer to remove the post count from your label widgets, here is a quick and easy way to remove it.






How to remove the post count from your label widget

The widget tag for the label post count is contained inside the widget template for the label widget itself. To remove the post count, we simply need to remove this widget tag.

To do this, go to Template>Edit HTML in your Blogger dashboard and ensure you have checked the "expand widget templates" box. Then you will need to locate your labels widget in the template. The easiest way to find it is to use your browser's search function and search for this partial line:

b:widget id='Label

This will easily help you locate your labels widget, even if this was not the first label widget you had installed in your template.

The whole code for the label widget will look something like this:

<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'>

<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:loop>

</ul>



<b:include name='quickedit'/>

</div>

</b:includable>

</b:widget>

I've highlighted the tag for the label post count in bold red. All you need to do is delete this line of code from your template (only the red part!) and there will no longer be a post count after each label in your list. You can preview your blog before saving to ensure the widget looks the way you had intended; if all is well, then go ahead and save your template. It really is this simple!

I hope this simple tutorial has been useful to you. I always appreciate your comments and suggestions, so please feel free to leave your comment below.


5 comments:

April 23, 2009 at 12:52 PM Megan said...

This is post was exactly what I was looking for, thank you!!!

May 6, 2009 at 3:31 AM Reza Winandar said...

Thank you very much for the articles, now my blog is better!

May 27, 2009 at 7:48 AM Sandeep said...

Congrats for writing an article with clarity but this article could have more comprehensive if You had mentioned how to add and show label tags in your blog post.Do you want to know more about labels such as how to add labels to a post and what is the significance of labels.Visit my blog at www.techieway.blogspot.com

July 2, 2009 at 8:41 AM Lise said...

Thank you very much!

August 7, 2009 at 11:34 PM bluelaugh said...

I want to add the labels beneath each post. That feature is checked off but nothing shows up. Does it have to do that I am using label cloud? What code do I need to have to fix this?

Post a Comment