Title: Category Post Counts
Last modified: August 18, 2016

---

# Category Post Counts

 *  [altstatten](https://wordpress.org/support/users/altstatten/)
 * (@altstatten)
 * [19 years, 1 month ago](https://wordpress.org/support/topic/category-post-counts/)
 * Okay, read every post I could find on this and found no answer that works or 
   is complete so here goes.
 * Added this—><?php wp_list_cats(‘sort_column=name&optioncount=1&hide_empty=0’);?
   >
 * …to get counts of posts in each category.
 * Problem: The counts are not next to the category name, but are below it on the
   next line.
 * This seems to be a common problem and the fix offered most often is an adjustment
   to the css file. The only detail offered that I can find was to add a line in
   the “Sub-Comment” area but my CSS file doesn’t HAVE a sub area.
 * ALL I NEED is for someone to tell me how to get the count to display next to 
   the category name. I loaded my css file in a post over a week ago but no one 
   tackled it, hence the new post.
 * Can anyone offer me instruction and a line of code that will remedy this please?

Viewing 13 replies - 1 through 13 (of 13 total)

 *  [Chris_K](https://wordpress.org/support/users/handysolo/)
 * (@handysolo)
 * [19 years, 1 month ago](https://wordpress.org/support/topic/category-post-counts/#post-544313)
 * If you’re asking for help with your theme (and you are) a link to it is beyond
   priceless for the folks who may be able to help.
 *  [alakhnor](https://wordpress.org/support/users/alakhnor/)
 * (@alakhnor)
 * [19 years, 1 month ago](https://wordpress.org/support/topic/category-post-counts/#post-544315)
 * wp_list_cats is deprecated with WP 2.1. Use wp_list_categories and show_count.
 *  [evrviglnt](https://wordpress.org/support/users/evrviglnt/)
 * (@evrviglnt)
 * [19 years, 1 month ago](https://wordpress.org/support/topic/category-post-counts/#post-544319)
 * v 2.1.2
 * I’m misunderstanding that answer. I did the what Alakhnor said and the category
   numbers still come out underneath the words…
 *  [Chris_K](https://wordpress.org/support/users/handysolo/)
 * (@handysolo)
 * [19 years, 1 month ago](https://wordpress.org/support/topic/category-post-counts/#post-544320)
 * Maybe I was too subtle?
 * A link to your blog, where this can be observed, would be really helpful.
 * If that’s not possible, perhaps sharing with us the theme name (if not homemade)
   would be a reasonable substitute.
 * You’re asking for help with CSS, but not giving anyone a look at what you currently
   have.
 *  Thread Starter [altstatten](https://wordpress.org/support/users/altstatten/)
 * (@altstatten)
 * [19 years, 1 month ago](https://wordpress.org/support/topic/category-post-counts/#post-544321)
 * Same here. Here’s my line of code:
 * <?php wp_list_categories(‘title_li=&sort_column=name&show_count=1’); ?>
 * [http://marketingmeasure.com](http://marketingmeasure.com)
 *  [evrviglnt](https://wordpress.org/support/users/evrviglnt/)
 * (@evrviglnt)
 * [19 years, 1 month ago](https://wordpress.org/support/topic/category-post-counts/#post-544322)
 * [Here’s my site.](http://politicalvindication.com/)
 * And my line in CSS:
    - <?php wp_list_categories(‘show_count=name&optioncount=1&hide_empty=0’); ?>
 * Here is my theme – rockinbizred3col 1.2
 *  Thread Starter [altstatten](https://wordpress.org/support/users/altstatten/)
 * (@altstatten)
 * [19 years, 1 month ago](https://wordpress.org/support/topic/category-post-counts/#post-544324)
 * Theme is Vertigo Enhanced.
    And I DID give my entire css file in a previous post
   but my query was ignored so I didn’t want to give it again.
 * My url is [http://marketingmeasure.com](http://marketingmeasure.com).
 * Be happy to post my css again if you like. Thanks for your help!
 *  [joyced](https://wordpress.org/support/users/joyced/)
 * (@joyced)
 * [19 years, 1 month ago](https://wordpress.org/support/topic/category-post-counts/#post-544374)
 * I think the problem is that the links to the categories are displayed as blocks(`
   display: block` in your CSS), this forces the post counts to the next line. There’s
   a line in your CSS that was probably put there to prevent this (`#l_sidebar ul.
   categories li a {display: inline;}`) but it doesn’t work because it should say`
   li#categories` instead of `ul.categories`. Hope that helps.
 *  [evrviglnt](https://wordpress.org/support/users/evrviglnt/)
 * (@evrviglnt)
 * [19 years, 1 month ago](https://wordpress.org/support/topic/category-post-counts/#post-544484)
 * Thanks Joyce – your input pushed me along to the answer. I went out and found
   a theme that had numbered categories, copied the code and pasted it into the 
   spot where the undesired code was. I went to the style sheet and changed the 
   display to ‘inline’ and it worked!
 * Problem solved!
 * Thanks!
 *  Thread Starter [altstatten](https://wordpress.org/support/users/altstatten/)
 * (@altstatten)
 * [19 years, 1 month ago](https://wordpress.org/support/topic/category-post-counts/#post-544566)
 * 🙂 Wanna share with the rest of us what that code was??
 *  Thread Starter [altstatten](https://wordpress.org/support/users/altstatten/)
 * (@altstatten)
 * [19 years, 1 month ago](https://wordpress.org/support/topic/category-post-counts/#post-544569)
 * Let’s try this again……..
 * Problem: Category post counts defaulting to the next line.
 * My function line: <?php wp_list_categories(‘show_count=1&title_li=&sort_column
   =name’); ?>
 * My relevant CSS:
 * /************************************************
    * Left Sidebar * ************************************************/
 * #l_sidebar {
    float: left; width: 225px; margin: 25px 0px 0px 20px; padding: 
   0px 0px 20px 0px; border-top: 2px solid #000000; }
 * #l_sidebar ul {
    list-style: inline; margin: 0px; padding: 0px; }
 * #l_sidebar ul li {
    display: inline; padding: 0px; margin: 0px; }
 * #l_sidebar ul li a {
    display: block; color: #000000; text-decoration: none; 
   margin: 0px; padding: 5px 0px 5px 0px; border-bottom: 1px solid #C0C0C0; }
 * #l_sidebar ul li a:hover {
    background: #EFEFEF; color: #910156; }
 * #l_sidebar p{
    padding: 3px 0px 0px 0px; margin: 0px; line-height: 20px; }
 * Can someone please tell me with some authority where the error is? Please.
 *  [joyced](https://wordpress.org/support/users/joyced/)
 * (@joyced)
 * [19 years, 1 month ago](https://wordpress.org/support/topic/category-post-counts/#post-544606)
 * Alstatten, my previous reply was actually directed to you. Add this line to your
   CSS:
 * `li.Categories li a { display: inline }`
 *  Thread Starter [altstatten](https://wordpress.org/support/users/altstatten/)
 * (@altstatten)
 * [19 years, 1 month ago](https://wordpress.org/support/topic/category-post-counts/#post-544613)
 * Yes, I know. But I haven’t been able to get any combination to work. I’ve tried:
 * This: #l_sidebar li.Categories li a { display: inline }
 * This: li.Categories li a { display: inline }
 * This: #l_sidebar ul li a {
    display: block; color: #000000; text-decoration: 
   none; margin: 0px; padding: 5px 0px 5px 0px; border-bottom: 1px solid #C0C0C0;}
 * This: #l_sidebar li.Categories li a {
    display: block; color: #000000; text-decoration:
   none; margin: 0px; padding: 5px 0px 5px 0px; border-bottom: 1px solid #C0C0C0;}
 * This: #l_sidebar li.Categories li a {
    display: inline; color: #000000; text-
   decoration: none; margin: 0px; padding: 5px 0px 5px 0px; border-bottom: 1px solid#
   C0C0C0; }
 * Nothing works. Please advise.

Viewing 13 replies - 1 through 13 (of 13 total)

The topic ‘Category Post Counts’ is closed to new replies.

 * 13 replies
 * 5 participants
 * Last reply from: [altstatten](https://wordpress.org/support/users/altstatten/)
 * Last activity: [19 years, 1 month ago](https://wordpress.org/support/topic/category-post-counts/#post-544613)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
