wordpress if is in category

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

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
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}