if the category has in wordpress code example
Example: wordpress if is in category
// Find out in Wordpress (with PHP) if a single/page is in a chosen category
if (in_category('fruit')) {
echo "This single/page is in category 'fruit'.";
}
// Find out in Wordpress (with PHP) if a single/page is in a chosen category
if (in_category('fruit')) {
echo "This single/page is in category 'fruit'.";
}