Sort a cached query
-
I have a query that I’m caching and updating every hour. However, I would like my visitors to be able to sort the query in 3 different ways. Essentially, I would like to use that cached query, instead of having to run the query again.
The three ways I need them to sort it are
1. by meta_value of a particular key, if that key doesn’t exist, just set the value to zero
2. by comment count
3. by dateI can operate each of these queries standalone, but am unsure how to “re-sort” a query once it has already been returned. Furhtermore, if I’m using “meta_key” as an argument along with orderby “meta_key_value” is there a way to still return posts without the meta_key?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Sort a cached query’ is closed to new replies.