Get the category names of child categories of a parent used inside the loop
Description
PHP Source Code
<!--Get category name start-->
<?php
foreach((get_the_category()) as $childcat) {
if (cat_is_ancestor_of(4, $childcat)) {
echo '</li>'.$childcat->cat_name.'</li>' ; }}
?>
<!--Get cetegory name End-->
<!--Get category name start-->
<?php
foreach((get_the_category()) as $childcat) {
if (cat_is_ancestor_of(4, $childcat)) {
echo '</li>'.$childcat->cat_name.'</li>' ; }}
?>
<!--Get cetegory name End-->