Single Event Page Affecting Custom Programmed Event Slider

Home Forums Calendar Products Events Calendar PRO Single Event Page Affecting Custom Programmed Event Slider

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1148204
    Glen Draeger
    Participant

    I have a custom event slider that shows events from one event category. This works fine everywhere except on a single event page. There it is showing the correct category, but is also showing past events. Is there a way to stop showing past events in my custom code? I don’t even understand how the page itself is affecting my custom code.

    #1148205
    Glen Draeger
    Participant

    Here’s my query:

    $args2 = array(
    ‘post_type’ => ‘tribe_events’,
    ‘posts_per_page’ => 20,
    ‘orderby’ => ‘menu_order’,
    ‘order’ => ‘ASC’,
    ‘tax_query’ => array(
    array(
    ‘taxonomy’ => ‘tribe_events_cat’,
    ‘field’ => ‘slug’,
    ‘terms’ => ‘special-events’,
    )
    )
    );

    #1148292
    Geoff
    Member

    Hey Glen,

    Great question!

    I think a better way to approach the query would be to use the tribe_get_events function rather than get_posts, for the simple reason that it automatically fetches upcoming events rather than both past and upcoming.

    Here are a few example of how that works:

    Using tribe_get_events

    Will that do the trick for you? Please let me know. 🙂

    Cheers!
    Geoff

    #1156691
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Single Event Page Affecting Custom Programmed Event Slider’ is closed to new replies.