has_category() not working – alternatives? Post date Home › Forums › Calendar Products › Events Calendar PRO › has_category() not working – alternatives? This topic has 3 replies, 2 voices, and was last updated 12 years ago by Casey. Viewing 4 posts - 1 through 4 (of 4 total) Author Posts April 22, 2014 at 3:57 am #139274 Adrian CumpanasuParticipant Hi! I was trying to check if the event has a category, but it returns always false. What can I use instead? P.S. I used this code: http://pastebin.com/GxNAQRbt in case there isn’t a similar function inside the plugin thanks! April 22, 2014 at 8:10 am #139537 CaseyParticipant advmaremma, Thanks for getting in touch! Since the ‘tribe_events’ custom post type implements a custom taxonomy for our Event Categories, you’ll need to use the has_term method instead. Something like this should do the trick: if( has_term( 'category-slug-to-check', 'tribe_events_cat' ) ) { // do something } Give that a shot and let me know if it does the trick for you. Thanks! 🙂 -Casey- April 23, 2014 at 1:38 am #140152 Adrian CumpanasuParticipant working great! thanks! April 23, 2014 at 7:26 pm #140909 CaseyParticipant Great! Thanks for confirming that this got you sorted. Since it looks like you’re all set, I’m going to mark this thread “Answered” and close it out. By the way, if you have a minute or two, we would love it if you’d write a few words for us here: http://wordpress.org/support/view/plugin-reviews/the-events-calendar?filter=5 Thanks in advance. 🙂 Cheers, Casey Author Posts Viewing 4 posts - 1 through 4 (of 4 total) The topic ‘has_category() not working – alternatives?’ is closed to new replies. → Please verify your API key is correctly entered on the settings