WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. krogsgard
    Member
    Posted 2 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.

    Thanks,

    Brian

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

  2. krogsgard
    Member
    Posted 2 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
    Member
    Posted 2 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

    Cheers

  4. krogsgard
    Member
    Posted 2 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

About this Topic