Conditional tag to test if is in list view?

Home Forums Calendar Products Events Calendar PRO Conditional tag to test if is in list view?

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #18687
    Jesse
    Member

    tribe_is_upcoming() tests if the query is set to upcoming events, but applies to any page where I am querying events… For example I query events on my homepage and tribe_is_upcoming() returns true.

    Is there a function to tell if I’m specifically in *list view*? I.E. in myurl.com/events/*** ? If not there should be!

    Thank you!

    #18709
    Jonah
    Participant

    Hi Jesse,

    I’ve compiled conditional wrappers for all the main event pages here: https://gist.github.com/2415009

    I hope that helps!

    #22255
    David
    Participant

    Does
    if( tribe_is_event() && !tribe_is_day() && !is_single() )
    return true if I am using an override list.php in my theme /events folder? It doesn’t seem to …

    #22272
    Rob
    Member

    Hey David. Not sure about this myself, but let me get Jonah to take a look when he hits the forums today. Stay tuned.

    #22463
    Jonah
    Participant

    Hi David,

    That should return true. If not, try:

    if($query->query_vars['eventDisplay'] == 'upcoming' && !is_tax(TribeEvents::TAXONOMY) || $query->query_vars['eventDisplay'] == 'past' && !is_tax(TribeEvents::TAXONOMY) && $query->query_vars['post_type'] == TribeEvents::POSTTYPE && empty( $query->query_vars['suppress_filters'] ) ) {

    I hope that helps!

    – Jonah

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Conditional tag to test if is in list view?’ is closed to new replies.