あなたはこれを試すことができます
function category_has_parent($catid){
$category = get_category($catid);
if ($category->category_parent > 0){
return true;
}
return false;
}
次のように使用します
if(category_has_parent('5')) // 5 is the category id
{
echo "it has a parent !";
}