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
If you review the ‘orderby’ documentation on:
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’
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!
The new features in ACF 6.1 mean we’ve nearly doubled the number of translatable strings, and we need help translating them into your language. See how translations are progressing and how you can help at the link below. https://t.co/TkEc2Exd6U— Advanced Custom Fields (@wp_acf) May 17, 2023
© 2023 Advanced Custom Fields.