I try to build something that can sort posts by day - and within the same day sort them with any meta value (integer) - like popularity or vote or what have you.
So that, in the end, i get today's posts ordered by meta, then yesterday posts by meta, etc, etc...
The WordPress query object allows nice multiple table sorting since v4, including meta data.
<?php $the_query = new WP_Query(
array(
'meta_key' => 'my_meta_field',
'orderby' => array(
'date' => 'DESC',
'my_meta_field' => 'DESC'
)
)
);
?>
But the orderby
date seems more like time based, where i would need something day based. My posts are then ordered just by time, ignoring the meta field.
Any help ?
WP:_Query
.