There’s a lot of great documentation on multiple column sorting using
orderby however I can’t seem to find a good
WP_Query solution to this problem.
Each post has two meta keys:
I want to query posts by
rating_au as a priority and then falling back to
rating_overall if no value for
I have got as far as the following query:
I think I’m probably misunderstanding how this translates to MySQL but it does not produce the desired outcome (it simply lists descending order for
I’m wracking my brains on this and am looking to avoid
$wpdb or running multiple queries and merging values.
It’s likely there’s an entirely different approach to this problem. Any suggestions are gratefully received!