Revolution Slider Orderby Two Custom Fields


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:

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:

'orderby'  => array(
    'event_start_date' => 'ASC',
    'event_end_date' => 'ASC',

Can anyone give me some idea, how I change the ‘orderby’?


, , , AntTeam Elvin 6 years 2016-11-08T21:54:06-05:00 0 Answers 104 views 0

Leave an answer