Add numbers after categories

| Ayda | blogsome

I just move in to Blogsome, and still trying to understand how it’s work, so I hope this tips will be useful for someone that got the same problem with me.

This morning, I wondering how to show number of post in each category that I have in my sidebar, if you don’t know what I am talking about, please see the categories section in my sidebar, in there, next to the category name, there is a number that represent number of post in each category.

After googling in the internet, I found ‘list_cats’ tag in WordPress documentation. Blogsome was using WordPress engine, so I assume that Blogsome will use the same function with WordPress. I was right about this, Blogsome was really using the same tag, but with different way of calling it.

If you wanna know how to use it in WordPress blog, please go to here, but if you are like me, using Blogsome as your blog provider, you could use this following code to show number of post in each category of your blog:

     {list_cats optionall=’1′ all=’All’ sort_column=’name’ optioncount=’1′ children=’1′ hierarchical=’1′}

We don’t need to use <li> tag, ‘cause this function always return formatted list of category that already have <li> tag in it. If you are a beginner like me, than maybe you want to know what’s the meaning of that sentence is. list_cats is the name of the function to get the category from database, this function have some parameters like option_count to display the number of post in each category, sort_column to sort the category base on specified column name, hierarchical to display the list in hierarchical order (category then subcategory/children), children is to show the children or not. ‘1′ for true, ‘0′ for false.

This is how its gonna look like (actually, its depend on your stylesheet):

blog templates (2)
blog tips (1)
blogosphere (3)
personal life (4)

Related Entries:

Random Entries:

Tinggalkan Komentar Anda