Home › Forums › ACF PRO › Select field array problem… › Reply To: Select field array problem…
Hey there!
Thanks massively for the help, I worked it all out now.
If this helps, here is my code for anyone else 🙂
Field name is ‘Location’
There are a lot of location stored as an array. To display the first one from the array (if there are multiple values) if just one value display that…
if(get_field('location') == "location");
$values = get_field('location');
if ( is_array($values) ) {
echo $values[0];
} else {
echo "$value";
}
Thanks again! ]
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.