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:
- Open the file
includes/class-tecslider-function.php
.
- Go to line 188 (after
$events?=?tribe_get_events(?$args?);
).
- 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 );
- 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!