How do I run some php in the single event view if category matches if statement?

Home Forums Calendar Products Events Calendar PRO How do I run some php in the single event view if category matches if statement?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #971302
    Gaye
    Participant

    I’ve tried:

    if (is_tax(‘tribe_events_cat’, ‘category1’)) {
    echo ‘content’;
    }

    This does not work in the actual single event view.

    Any help would be really appreciated!!

    #971490
    Brian
    Member

    Hi,

    Thanks for using our plugins. I can try to help out here.

    That conditional is for archive pages and does not work in a single template.

    You can try using get_terms() to get all the event categories:

    https://codex.wordpress.org/Function_Reference/get_terms

    Then check what terms it returns and do something then.

    Cheers

    #984369
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘How do I run some php in the single event view if category matches if statement?’ is closed to new replies.