<?php
//for this category on an archive page, get the ID
$thisID = get_query_var('cat');
$get_children_cats = array(
'child_of' => $thisID //get children of this parent using the thisID variable from earlier
);
//firstly, load data for your child category
$child = get_category($thisID);
//from your child category, grab parent ID
$parent = $child->parent;
//load object for parent category
$parent_name = get_category($parent);
//grab a category name
$parent_name = $parent_name->name;
echo '<strong><a href=" ' . get_category_link( $parent ) . ' ">' . $parent_name . '</a></strong><p>';
$child_cats = get_categories( $get_children_cats );//get children of this parent category
foreach( $child_cats as $child_cat ){
//for each child category, get the ID
$childID = $child_cat->cat_ID;
echo '<strong> - <a href=" ' . get_category_link( $childID ) . ' ">' . $child_cat->name . '</a></strong>';
} //end of categories logic
?><p>
<!-- end -->
Home
code