Forums
Home / Fixing WordPress / How to sort category posts by meta_value?
(@modeman)
10 years, 1 month ago
Hello, im using WP-Types plugin and i need to sort category posts by meta_value.
Now i have this code: http://pastebin.com/0bYqcBDU
I need all posts with meta_value “wpcf-data-nuo” empty field go down and posts with typed meta_value goes up (sorting).
Any advices?
(@vtxyzzy)
Here is an article that shows one way to modify the query with filters: http://wordpress.mcdspot.com/2013/01/25/sort-on-presence-of-custom-field-field-value-then-date/