Ready to get started?Download WordPress


[resolved] Get children of parent category (2 posts)

  1. KiddoMono
    Posted 8 years ago #

    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?

  2. KiddoMono
    Posted 8 years ago #

    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);

Topic Closed

This topic has been closed to new replies.

About this Topic