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

2

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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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