Hopefully this is a reasonably straightforward question!
Is it possible to order posts, on the front-end of my WP install, by two meta values?
I have a meta key called genus
and another called species
. I’d like to sort firstly by genus
(ASC), then species
(ASC).
Thanks in advance,
AFAIK, you can’t do it using a meta query. Check this example, does what you want.
The simplest solution I can think of is to join the posts meta table with posts table twice. Modifying codex example a bit you can use this: