I have a wp query that works great – it returns a list of featured posts.
WP_Query(“category_name=office&meta_key=featured_post&meta_value=Yes&posts_per_page=3”);
However I want to add a 2nd custom key to the query (a custom order field) then order by the numerical value of the meta value of this key.. is it possible to use 2 meta_key values in a WP_Query? If not is it possible using an SQL query statement?
2 Answers
The query value parameters can be set to true ( returns single result) or false ( an array).
http://codex.wordpress.org/Function_Reference/get_post_meta
For instance http://www.mattvarone.com/wordpress/query-multiple-meta-values/