Title: Update get_category Function Reference
Last modified: August 21, 2016

---

# Update get_category Function Reference

 *  [Gemfruit](https://wordpress.org/support/users/gemfruit/)
 * (@gemfruit)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/update-get_category-function-reference/)
 * The function reference page for [get_category](http://codex.wordpress.org/Function_Reference/get_categories)
   is incomplete in my eyes, and could use an additional piece of information.
 * “Description
    Returns an array of category objects matching the query parameters.
 * Arguments are pretty much the same as wp_list_categories and can be passed as
   either array or in query syntax.”
 * I was using this code:
 * `$descendants = get_categories(array('child_of' => 2));`
 * What’s not listed here, is that if there are no posts in a category, those categories
   will not be returned. I was redoing my theme, and added a bunch of sub-categories,
   and had no posts currently in those categories, but planned on using them. When
   attempting to loop through all sub-categories, I was told I had X children, when
   I knew there were Y. Using my knowledge of programming, I eventually discovered
   the issue was due to those categories not having posts in them, but that’s extremely
   sloppy documentation, and very important information that should be shared with
   developer’s reading the function reference.
 * Please add something along these lines:
 * “No results will be returned for categories that do not contain posts.” – smoother/
   more informal wording can be done, but you get the picture.

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

 *  Moderator [cubecolour](https://wordpress.org/support/users/numeeja/)
 * (@numeeja)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/update-get_category-function-reference/#post-4160557)
 * The codex is a wiki updated by volunteers. Instead of posting here to suggest
   improvements, you can help with updating improving it yourself.
 * see: [http://codex.wordpress.org/Codex:Contributing](http://codex.wordpress.org/Codex:Contributing)
 *  Thread Starter [Gemfruit](https://wordpress.org/support/users/gemfruit/)
 * (@gemfruit)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/update-get_category-function-reference/#post-4160561)
 * I wasn’t aware of the update style, noted.
 * I’ll definitely proceed with that, as I’d love to contribute where possible. 
   While this topic is already open – would my above observation be correct / a 
   sensible addition?
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/update-get_category-function-reference/#post-4160608)
 * Those observations sound correct to me. From what I recall, wp_list_categories()
   displays exactly the same behaviour and, I think, uses get_categories().

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

The topic ‘Update get_category Function Reference’ is closed to new replies.

## Tags

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

 * In: [Requests and Feedback](https://wordpress.org/support/forum/requests-and-feedback/)
 * 3 replies
 * 3 participants
 * Last reply from: [esmi](https://wordpress.org/support/users/esmi/)
 * Last activity: [12 years, 7 months ago](https://wordpress.org/support/topic/update-get_category-function-reference/#post-4160608)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
