Support » How-To and Troubleshooting » WP_Query order by post meta numeric value
3 years, 5 months ago
Does WP_Query also check post_meta if needed? I need to order the posts by a numeric value of 1-3 in a post meta attribute, or possibly exclude from results if the value = 0.
How is this built into WP_Query?
'order' => 'ASC',
'meta_key' => 'your_meta_key',
'orderby' => 'meta_value_num'
I could not have figured out that on my own, period. Your awesome.