I have a category orientation as:

Series (ID: 15) (root category)

Under 'Series', the following sub-categories are present:

  • Series A (Contains 0 posts)
  • Series B (Contains 1 post)
  • Series C (Contains 0 posts)

How can I get the all three subcategories under the 'Series' category using 'get_terms'?

I have used the following parameter structure sent as $args (term query) to 'get_terms' with no result. It returns an empty array:

$arg['taxonomy'] = 'category';
$arg['hide_empty'] = 0;
$arg['parent'] = 15;
$arg['number'] => 0;
$arg['orderby'] = 'term_id';
$arg['order'] = 'ASC';

What am i doing wrong?

Please note that I want to achieve this through 'get_terms' only so that I can use the same for other custom terms too.


1 Answer 1


You've set number to 0, so it will do as told and return 0 terms. Remove the number argument if you want all matching terms.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.