Yes I definitely think the code I wrote wont work.
What I need is to display a field that has conditional logic to another.
I have a list of brands and models. To display brand is easy I just use <?php the_field(‘brand’) ?>
Now to display a model that has a conditional logic to that brand, that is when I find myself in trouble.
With your help I managed echo the name of the field.
$brand = get_field(‘brand’);
$model = “model_”;
$model_brand = $model . $brand;
What I need is a way to use this stored in the new variable “model_brand” to get the field “model_brand” to give you an example the field could be named “model_ford”. I am not sure this is the right path, probably not. But I imagine there has to be a way to display a field with conditional logic, right?
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!
© 2023 Advanced Custom Fields.