Support
Support » Fixing WordPress » Ordering posts by numerical custom field
(@swennet)
10 years, 11 months ago
I’m trying to order my posts by using the following code added to my url:
?meta_key=length&orderby=meta_value_num&order=desc
However, it doesn’t seem to actually order my posts by the numerical value of ‘length’.
Why does it not work?
(@keesiemeijer)
Try it with “orderby=meta_value_num” http://codex.wordpress.org/Function_Reference/WP_Query#Order_.26_Orderby_Parameters