You can check if a category has a parent, if it does it is a child category.
if( is_category() ){
$this_category = get_queried_object();
if( 0 != $this_category->parent ){
echo 'category has parent';
}
}
You can check if a category has a parent, if it does it is a child category.
if( is_category() ){
$this_category = get_queried_object();
if( 0 != $this_category->parent ){
echo 'category has parent';
}
}