I've got a site with a couple thousand time-stamped posts in a custom post type. These get displayed by a few taxonomies and a date query in various views (I've got that all working just fine already). The tricky part is ordering them by a unique date format: the client insists that posts should be ordered DESC by day, then ASC by time within each day. As far as I can see in the Codex, order
only takes date
as a param, not day & time as distinguishable values. Is there any way to accomplish what I'm looking for without substantial re-writes of a half-dozen archive-tax template files?
I'm using the following to sort DESC by date already and would love a solution that fits into this function:
function my_post_sort( $vars ) {
if ( is_tax(array('series', 'speakers', 'topics', 'venues'))) {
$vars['order'] = 'ASC';
}
return $vars;
}
add_filter('query_vars', 'my_post_sort');