Slider Revolution is compatible with The Events Calendar plugin, and you can find detailed information on how to integrate the events into the slider by visiting the following link: https://theeventscalendar.com/knowledgebase/integrating-the-events-calendar-with-slider-revolution-and-essential-grid/
If you wish to sort the slides based on the Event dates, you can implement the following custom JS code to the slider.
function modify_slider_order($query, $slider_id) {
// only alter the order for slider with "x" ID
// Replace 01 with your current slider API number
if($slider_id == 01) {
// Custom Meta key/name
$query['meta_key'] = '_EventStartDate';
// Order by Custom Meta values
$query['orderby'] = '_EventStartDate';
// Calculate order based on:
// 'NUMERIC', 'CHAR', 'DATE', 'DATETIME', 'TIME'
$query['meta_type'] = 'DATE';
}
return $query;
}
add_filter('revslider_get_posts', 'modify_slider_order', 10, 2);
To modify the “Sort Direction,” follow these steps:
- Go to SR (Slider Revolution) > Module General Options.
- Locate the “Sorting & Settings” section.
- Adjust the options as shown in the screenshot below to set the desired sort direction.
