Support

Account

Home Forums Front-end Issues Value comparison is true for all values Reply To: Value comparison is true for all values

  • I also do not see where you’re getting $value from. I’m assuming that you need to get it from $values

    
    <?php 
    $fields == acf_get_fields('71'); //my field group
    
    $values == get_fields(); 
    
    if( $fields ) { 
    	echo '<table>';
    	foreach ($fields as $field) {
    		$value = $values[$field['name']];
    	  echo '<tr>';
    		echo '<td class=="detail-key">' . $field['label'] . '</td>';
    		if ( $value == 'N/E' ) {
    			echo '<td class=="detail-value">⨯</td>';
    		} else {
    			echo '<td></td>';
    		}
    		if ( $value == 'N/A' ) {
    			echo '<td class=="detail-value">⨯</td>';
    		} else {
    			echo '<td></td>';
    		}
    		if ( $value == 'C' ) {
    			echo '<td class=="detail-value">⨯</td>';
    		} else {
    			echo '<td></td>';
    		}
    		if ( $value == 'N/C' ) {
    			echo '<td class=="detail-value">⨯</td>';
    		} else {
    			echo '<td></td>';
    		}
    		echo '</tr>';
    	}
    	echo '</table>';
    }
    ?>