How to Query this?
-
Hi,
My problem here is a little complicated (at least to me) so please bare with me here ??
So I have posts about books that have 2 custom field keys: Genre and “Number of Pages”
I’m trying to make a query that allows visitors to sort by “Number of Pages” within a Genre.
For example, say I have 5 posts:
1) Horror, 100
2) SciFi, 200
3) SciFi, 150
4) SciFi, 300
5) Horror, 50I want to query it so that it can display a table like so:
(Visitor clicks on Horror, and sort by Number of Pages)
Horror 50
Horror 100(Visitor clicks on SciFi, and sort by Number of Pages)
SciFi 150
SciFi 200
SciFi 300The problem is that both “Genre” and “Number of Pages” are “meta keys” so how do I select one meta_value (ones from Genre), and sort by another meta_value (ones from Number of Pages)?
Thanks.
- The topic ‘How to Query this?’ is closed to new replies.