WordPress.org

Support

Support » Plugins and Hacks » The Events Calendar » [Resolved] [Plugin: The Events Calendar] Conditional for Calendar pages?

[Resolved] [Plugin: The Events Calendar] Conditional for Calendar pages?

  • 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.

    Thanks,

    Brian

    http://wordpress.org/extend/plugins/the-events-calendar/

Viewing 3 replies - 1 through 3 (of 3 total)
  • 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.

    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

    Cheers

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

    Thanks, Joey!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] [Plugin: The Events Calendar] Conditional for Calendar pages?’ is closed to new replies.
Skip to toolbar