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
I really appreciate all your help! Sorry I’m not doing the best job explaining or understanding.
When I echo the results of ‘application_type’ it is printing out “Array”, unless I do $arr then it will print out like “Bathtub”.
$arr = get_field('application_type', $post->ID); echo $arr;
I want my orderby to use just the first item in the Array, currently it won’t even work period, even if just one value in ‘application_type’. I am allowing the admin to select checkboxes, but tried allowing them to select just one value from a drop down and the orderby works great.
Hopefully I am making a little more sense? Thank you so much for your help!
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've just released ACF 5.12.3 with a security fix to prevent arbitrary file uploads to forms with ACF fields.— Advanced Custom Fields (@wp_acf) July 14, 2022
Now that we've released this update, we recommend updating your sites as soon as possible.
© 2022 Advanced Custom Fields.