Home › Forums › Front-end Issues › Displaying a field that is conditional to another › Reply To: Displaying a field that is conditional to another
So
1) you need to fetch the name of the brand, ie ford
or bmw
and you currently do this with $brand = get_field('brand');
2) you then need to fetch the models using this brand variable and your naming structure is model_$brand
essentially. to do this you’d then say $models = get_field('model_'.$brand);
Have you tried this?
What do you see if you try do print_r($models)
?
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.