Support » Fixing WordPress » Get children of parent category

  • Resolved KiddoMono


    Is there a function that is the opposite of get_category_parents()? Instead of getting the parents of a category, I would like a list of the children in a specific category. Is it possible?

Viewing 1 replies (of 1 total)
  • Silly me of course there is. Use this:
    <?php $cat = get_the_category(); $cat = $cat[0]; $catid = $cat->cat_ID; ?>
    <?php wp_list_cats(‘child_of=’.$catid);

Viewing 1 replies (of 1 total)
  • The topic ‘Get children of parent category’ is closed to new replies.