The Events Calendar
[resolved] Conditional for Calendar pages? (4 posts)

  1. Brian Krogsgard
    Posted 4 years ago #

    For the life of me, I cannot figure out what conditionals will work on the events calendar archive pages. By this, I mean my base page, which I would anticipate would return true for is_post_type_archive('tribe_events'), does not do so.

    What conditionals can I use for the main events / calendar page? Preferably, if there is one that will return true on any archive page for the plugin generated URLs, that would be great.




  2. Brian Krogsgard
    Posted 4 years ago #

    So my base slug is 'calendar'.

    I've found that it is returning true to a generic is_page() check, which doesn't help much.

    calendar/upcoming returns true on a 'tribe_events' == get_post_type() check, which starts to help.

    other URLS like calendar/month, calendar/2012-03 (and other date archives) are returning true for the same is_page() check... none of it makes much sense.

    I've tried it both with a page called 'calendar' and without, and it makes no difference.

    Anywho, just some extra info.

  3. Joey Kudish
    Posted 4 years ago #

    After discussing privately with Brian, here is the solution we found:

    if ( (get_post_type() == 'tribe_events' && tribe_is_upcoming()) || tribe_is_month() || tribe_is_by_date() )

    In 2.1 we'll implement a proper tribe_is_archive() though


  4. Brian Krogsgard
    Posted 4 years ago #

    Indeed, this is correct. That grabs everything related to TEC stuff.

    Thanks, Joey!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • The Events Calendar
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic