Support

Account

Home Forums Backend Issues (wp-admin) if function is not working in archeive. php file Reply To: if function is not working in archeive. php file

  • 1. If select_the_value is a true/false field, it will already return true/false, so if(get_field('select_the_value')) should be enough.
    2. If select_the_value is another kind of field (e.g. checkbox or select), 'TRUE' must be defined as a field option (ergo be a string), otherwise it won’t match

    In other words, this might work like this:

    
    $fieldName = get_field('select_the_value') ? 'select_the_country' : 'select_the_city';
    the_field($fieldName, $queried_object);