WordPress category list of any parent category

i want to show list of child categories of Blog category. how do i do that?

Thank you

Related posts

Leave a Reply

2 comments

  1. Try this code which will display child categories of the current post:

    $category=get_the_category();
    $parent_id = $category[0]->cat_ID;
    
    foreach($category as $childcat) 
    {
      if (cat_is_ancestor_of($parent_id, $childcat)) 
      {
        echo $childcat->cat_name;
      }
    }
    

    Put it inside the loop.