I found this link about “a more powerful ORDER BY in WordPress 4.0” and it led me to try this code:
<?php
$query = new WP_Query( array(
'post_type' => 'result',
'posts_per_page' => 100,
//'paged' => $paged,
'meta_key' => 'event_date_results',
'orderby' => array( 'meta_value_num' => 'DESC', 'post_date' => 'DESC'),
//'order' => 'DESC',
'meta_value' => date('Ymd'),
'meta_compare' => '<',
'date_query' => array(
array(
'key' => 'date',
'value' => date('Ymd'),
'compare' => '<', //less than
'type' => 'DATETIME'
)
),
) );
?>
The ‘orderby’ line is the only thing I changed (and I commented out the other ‘DESC’ line I had… which I could delete now.)
…don’t mind my commented out ‘paged’ bit… I’m still figuring out how to paginate this as well. 😉