$p_id = get_the_ID();
$cat_srt = get_category_parents(get_the_category($p_id)[0] ,false, '|');
$catParentName = explode('|',$cat_srt)[0];
$p_id = get_the_ID();
$cat_srt = get_category_parents(get_the_category($p_id)[0] ,false, '|');
$catParentName = explode('|',$cat_srt)[0];