//get category name foolproof echo (!empty(get_the_category($post)) ? get_the_category($post)[0]->name : '');