Support

Account

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?