Support

Account

Home Forums General Issues [WP_Query > orderby] Merge date and time fields Reply To: [WP_Query > orderby] Merge date and time fields

  • I had not seen the little subtlety!
    It works! Thank you very much!

    I put the code for people who would have the same problem:

    'meta_query' => array(
    	'relation' => 'AND',
        'date_clause' => array(
            'key' => 'event_date',
    		'compare'	=> '=',
        ),
        'time_clause' => array(
            'key' => 'event_time',
    		'compare'	=> '=',
        ),
    ),
    'orderby' => array(
    	'date_clause' => 'ASC',
    	'time_clause' => 'ASC',
    ),