1

I have custom post type called events it has event_type taxonomy with two terms namely past-events, upcoming-events. I want to check my single post's term whether it's under past-events or upcoming-events Based on that i can display message. Thank you All

1 Answer 1

2

If I understand you correctly, then has_term should be solution for your problem...

if ( has_term( 'past-events', 'event_type' ) ) {
    // do something
}
1
  • Hi Krzysiek Dróżdż Thanks for the answer that works fine.
    – joe
    Commented Oct 15, 2018 at 6:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.