By default, the Labels Widget that can be added into your Blog through Template -> Page Element -> Add a Page Element will have an automatic count of the number of posts bearing that label tag.
If you don't like to see the count, or you want to change the brackets to square brackets or something else, you can edit the template code. Before any change, remember to back up your template. Go to Template -> Edit HTML and save a copy of your existing template by clicking the “Download Full Template” link. Next, check the “Expand Widgets Template” box.
We assume you already have a Labels widget in your Blog. Our task is to locate this widget in the template. If your Labels widget has a title, it is easy. Simply search (using Ctrl-F in most browsers) for the title. Every label widget is assigned an ID such as id='Label1' or id='Label2' and so on. If you don't have a title for your Labels widget, search for these IDs. Another method which we strongly recommend is for you to enter a temporary title into that Labels widget and search for that title. You can always remove the title after you have amended the template.
The part of the template that defines your Labels widget will look like this:-
<b:widget id='Label1' locked='false' title='' type='Label'>
<b:loop values='data:labels' var='label'>
<b:if cond='data:blog.url == data:label.url'>
If you don't want the number count to appear after the Labels, delete the portion in red.
Should you want a square bracket, change the portion in red to:-
If you want a hyphen followed by the number, change the red line to:-
Preview the Template. If this is what you want, save the Template and refresh the Blog page.
© Tricks for New Bloggers