Sort by Meta fields using URL
-
I’m sorting a list of posts by using a simple url format:
-
?orderby=title&orderby=post_parent&order=ASC
at the end of my main page, which would normally just list of posts by date posted.
The above works perfect. Also, the previous and next work along with that perfectly.
However, when I try to use meta data fields, it doesn’t work:
-
?meta_key=_count-views_all&orderby=meta_value_num&order=DESC
It doesn’t actually sort by the count views listed in the database.
I’ve looked at the all the numbers and I actually can’t figure out how it’s sorting, because it’s different than the regular link without the parameters.
Any ideas on why this is happening?
Thanks!!!!
- The topic ‘Sort by Meta fields using URL’ is closed to new replies.