Home › Forums › General Issues › need to select first item in meta_value array to sortby › Reply To: need to select first item in meta_value array to sortby
Hi @crushdg
If you review the ‘orderby’ documentation on:
http://codex.wordpress.org/Class_Reference/WP_Query
You will see that the ‘orderby’ => ‘meta_value’ param will then tell WP to order the posts by the field name in the param ‘ ‘meta_key’ => ‘application_type’
So your code above looks like it will order the posts by ‘application_type’ value.
I don’t understand what you mean by:
Currently the orderby ‘meta_value’ is an array
In the above code, orderby is not an array. It is a string with a value of ‘meta_value’
Thanks
E
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.