Support

Account

Home Forums ACF PRO Order CPT by Date Picker then by Time Picker Reply To: Order CPT by Date Picker then by Time Picker

  • 
    $date_query = new WP_Query(array(
                        'post_type'         =>'sessions', 
                        'posts_per_page'    => -1,
                        'meta_query'        => array(
                            'relation'  => 'AND',
                            'date_q' => array(
                                'key'       => 'session_date', 
                                'compare'   => '=',
                                'value'     => $dayKey,
                                'type'      => 'date'
                            ), 
                            'time_q' => array(
                                'key'       => 'start_time', 
                                'compare'   => 'EXISTS',
                                'type'      => 'TIME'
                            ), 
                        ),
                        'orderby'        => array('date_q' => 'ASC', 'time_q' => 'ASC')
                    ));  ?>