wordpress if is in category

Solutions on MaxInterview for wordpress if is in category by the best coders in the world

showing results for - "wordpress if is in category"
Dante
14 Sep 2016
1// Find out in Wordpress (with PHP) if a single/page is in a chosen category
2if (in_category('fruit')) {
3    echo "This single/page is in category 'fruit'.";
4}