I have create Revolution Slider which load the custom post type, Events. There are two custom fields, Event Start Date and Event End Date. I would like to display order by Start and End date. Because now only able order by Start date and if same Start date, then will order by Title.
Here is what I found from Revolution Slider website:
https://www.themepunch.com/faq/sort-options-post-based-sliders/
function modify_slider_order($query, $slider_id) {
if($slider_id == 4) {
$query['meta_key'] = 'event_start_date';
$query['orderby'] = 'event_start_date';
$query['meta_type'] = 'DATE';
$query['order'] = 'ASC';
}
return $query;
}
add_filter('revslider_get_posts', 'modify_slider_order', 10, 2);
However, I unable able to add array to 'orderby'. According this:
http://www.billerickson.net/wp-query-sort-by-meta/
'orderby' => array(
'event_start_date' => 'ASC',
'event_end_date' => 'ASC',
),
Can anyone give me some idea, how I change the 'orderby'?
Thanks!