• Resolved hecdev

    (@hecdev)


    I try to do a slider with “upcoming” events, but the slider do not show my ongoing event.
    This on going event is not show with a “past” slider neither.

    What can i do ?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author mywptrek

    (@mywptrek)

    Hi,

    Thanks for pointing this out! The issue arises because ongoing events (events currently in progress) aren’t included in either the “upcoming” or “past” event sliders by default. However, you can resolve this by making a small modification in the plugin code.

    If you’re familiar with PHP, please follow these steps:

    1. Open the file includes/class-tecslider-function.php.
    2. Go to line 188 (after $events?=?tribe_get_events(?$args?);).
    3. Add the following code snippet to include ongoing events in your slider:
    $current_args   = array(
    'meta_query' => array(
    'relation' => 'AND',
    array(
    'key' => '_EventStartDate',
    'value' => current_time( 'mysql' ),
    'compare' => '<=',
    'type' => 'DATETIME',
    ),
    array(
    'key' => '_EventEndDate',
    'value' => current_time( 'mysql' ),
    'compare' => '>=',
    'type' => 'DATETIME',
    ),
    ),
    'post_status' => 'publish',
    'posts_per_page' => -1,
    );
    $current_events = tribe_get_events( $current_args );
    $events = array_merge( $current_events, $events );
    1. Save the file and test your slider.

    This snippet ensures that ongoing events (currently running) are included in the respective “upcoming” or “past” sliders based on their start and end dates.

    Let me know if this resolves the issue or if you need further assistance!

    Thread Starter hecdev

    (@hecdev)

    Thanks you, it works just fine !!

    • This reply was modified 2 months, 1 week ago by hecdev.
    Plugin Author mywptrek

    (@mywptrek)

    Glad to hear that it worked! If you have any other questions, feel free to ask. Marking this thread as resolved.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.