Home › Forums › Front-end Issues › Displaying a field that is conditional to another › Reply To: Displaying a field that is conditional to another
Hi @cezilia_mar
Not sure if I’m understanding your query, however the 1 problem I can see in your code is this: get_field('$modelos_marca')
If you’re fetching a variable, you can drop the quotes so that it becomes: get_field($modelos_marca)
So your code might be:
$brand = get_field('brand');
$modelo_brand = "modelo_" . $brand;
if(get_field('marca')) {
echo get_field($modelo_brand);
}
Alternatively, perhaps you could clarify your problem?
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.