Title: Changing category count in widget
Last modified: January 8, 2017

---

# Changing category count in widget

 *  [coolpillows](https://wordpress.org/support/users/coolpillows/)
 * (@coolpillows)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/changing-category-count-in-widget/)
 * First of all, apologies if this is not really a heavy “WP Development” topic,
   but it’s not really “Fixing WP” and didn’t seem to fit the other categories. 
   While I’m not a hard-code developer, I like to learn and have enough knowledge
   to be dangerous. (uh-oh)
 * I’m trying to control the number of categories in the Category list of my sidebar.
   From here:
    [https://developer.wordpress.org/reference/functions/wp_list_categories/](https://developer.wordpress.org/reference/functions/wp_list_categories/)
 * I see there are parameters like show_option_all and show_option_none but nothing
   that lets me set the number of categories displayed in the list. I’d like to 
   show, say maybe 5 of the top categories, or even better, control/hard code exactly
   which categories with a “see all categories” at the bottom of the list.
 * The site is [http://www.madnessmuseum.com](http://www.madnessmuseum.com) … using
   the Twenty Sixteen Theme, up-to-date on WP, theme version, blah blah.
 * In in the interest of learning, and maybe making it more complicated for myself(
   why?!?!), I’m also looking to do this within the current theme. In fact, a lot
   of themes I’ve explored still don’t seem to provide the ability to control the
   number of categories. I’m also trying to avoid scouring for a one single plug-
   in that does just what I want for category list.
 * Can anyone help?? Thanks in advance!
 * Lee

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

 *  Moderator [t-p](https://wordpress.org/support/users/t-p/)
 * (@t-p)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/changing-category-count-in-widget/#post-8631697)
 * See if this points you in the right direction: [http://wordpress.stackexchange.com/questions/248765/how-to-limit-number-of-number-of-categories-displayed-by-categories-widget](http://wordpress.stackexchange.com/questions/248765/how-to-limit-number-of-number-of-categories-displayed-by-categories-widget)
 *  Thread Starter [coolpillows](https://wordpress.org/support/users/coolpillows/)
 * (@coolpillows)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/changing-category-count-in-widget/#post-8631734)
 * Thanks t-p! I **think** I glanced at this in an original search but probably 
   shied away b/c it either offers the dropdown solution which is not what I want
   OR, go ahead, make yourself a custom widget. This is the good & bad thing about
   WP…so many options but there’s a widget for everything. Let’s see what else comes
   up here on the forum or maybe I’ll hack out a widget for myself when I’m not 
   darning my socks or sumpin. 🙂
 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/changing-category-count-in-widget/#post-8631913)
 * That SE post would scare away many looking for a simple solution. If you were
   able to filter out extraneous information (not a simple task), the answers you
   seek are there, just not that apparent. For example, the dropdown output style
   has nothing to do with the query arguments to get categories in a particular 
   manner.
 * The other thing that’s not clear is you can supply any get_terms() arguments 
   in wp_list_categories() even though they are not listed in the wp_list_categories()
   arguments descriptions. This means you can just supply the “number” argument 
   and it’ll be passed on through and used in the eventual get_terms() call several
   layers down the call stack.
 * The other useful take away from the SE post is you probably want to order the
   list by “count” so the most common categories show up in the shortened list.
 * One last thing, thank you for giving the appropriate forum to post in some consideration.
   Many forum titles are virtually brand new and the criteria of what goes where
   beyond what each description says has not been defined. Anything in a gray area
   such as yours would be given the benefit of doubt. You’d be fine either way. 
   AFAIC, if you are writing custom code, you are a “Developer” in these forums 
   😉
 *  Thread Starter [coolpillows](https://wordpress.org/support/users/coolpillows/)
 * (@coolpillows)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/changing-category-count-in-widget/#post-8632043)
 * shucks thanks bc. i didn’t swear i was going to write custom code…just considering
   it. but benefit of the doubt is better than saying, ‘how dare u post this you
   noob!’
    and i just realized there was a typo above and i meant to say, hard-_core_
   developer, not hard-code dev. in some circles, that alone would get sent to banished
   beginner forum for life. #hardcoreforlife 😉

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

The topic ‘Changing category count in widget’ is closed to new replies.

## Tags

 * [categories](https://wordpress.org/support/topic-tag/categories/)
 * [list](https://wordpress.org/support/topic-tag/list/)
 * [widgets](https://wordpress.org/support/topic-tag/widgets/)

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 4 replies
 * 3 participants
 * Last reply from: [coolpillows](https://wordpress.org/support/users/coolpillows/)
 * Last activity: [9 years, 5 months ago](https://wordpress.org/support/topic/changing-category-count-in-widget/#post-8632043)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
