Conditional wrappers, single event, select category

Home Forums Calendar Products Events Calendar PRO Conditional wrappers, single event, select category

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #70158
    Mariano
    Participant

    Hi guys.
    I’m trying to customize my views using the conditional wrappers (https://gist.github.com/jo-snips/2415009). I had no problems working aroung with the views. The thing is, I want to customize the single event view for only one category
    I tried using this code, but did not work:

    elseif(
    tribe_is_event() && is_single() && is_tax('tribe_events_cat','my_category') ):

    How can I work around to condition only one category on a single?

    #70335
    Barry
    Member

    Hi Mariano,

    I think you’re misunderstanding the role of is_tax() which checks if the current request is a query for an existing taxonomy archive page – which won’t hold true in the context of a single event page.

    You might be interested in using has_term() instead 🙂

    #70475
    Mariano
    Participant

    Worked great! Thanks Barry

    #70522
    Kelly
    Participant

    So glad to hear it, Mariano! Since you’re good for now, I’m going to close this thread. Please open up a new one if anything else comes up.

    Thanks for being a TEC user!

    #981394
    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 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Conditional wrappers, single event, select category’ is closed to new replies.