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.
Hello,
I have tried to implement this however it isn’t functioning correctly. Just to verify, is the slider API the same as the slider ID?? If not, where do I obtain the Slider API number? Also, should I be placing code in this window (see screenshot URL in the Website field). Thank you for the help.
Hi Georges,
Slider API and Slider ID are different. Slider contains Slider ID for example, to show a popup when slider start we can use api[Engine 6 API] “revapi.revstart();” but if a page has multiple sliders this api would attach popup to all of them for that reason we can add an ID to the API “revapi88.revstart();”. Refer to this link to find slider ID: https://www.sliderrevolution.com/faq/custom-sorting-for-post-based-modules/. You can also add custom ID/Classes, and the code should be add to Custom JS section, see this for custom ID/Classes and Custom JS area link: https://www.sliderrevolution.com/manual/custom-css-and-javascript-with-slider-revolution/.