Checking for single event with conditionals

Home Forums Calendar Products Events Calendar PRO Checking for single event with conditionals

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1097656
    Enoch
    Participant

    Hi,

    I am trying to check whether a page is a single event page using the conditional tribe_is_event() and is_single()

    is_single() works but not tribe_is_event(), and I need to make sure its a tribe event and not just a regular single page.

    The page slug is: website.dev/event/title-of-event

    Any thoughts?

    • This topic was modified 10 years ago by Enoch.
    • This topic was modified 10 years ago by Enoch.
    #1097821
    George
    Participant

    Hey @rubeez,

    Thanks for reaching out!

    tribe_is_event() should be working on single-event pages, and it does for me when I test on my local site, so I’m not quite sure what’s going wrong on your site. In the meantime, though, this might work well as an alternative:

    is_singular( 'tribe_events' )

    You can use this as a replacement for both is_single() and tribe_is_event(). Learn more about is_singular() here → https://codex.wordpress.org/Function_Reference/is_singular

    I hope this helps!
    George

    #1099562
    Enoch
    Participant

    Thanks, that worked perfectly.

    #1099596
    George
    Participant

    Nice! 🙂

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Checking for single event with conditionals’ is closed to new replies.