Support

Account

Home Forums Front-end Issues Value return number(index) instead word's Reply To: Value return number(index) instead word's

  • Because the single choices value is not a string but an array of values itself.
    http://www.advancedcustomfields.com/resources/get_field_object/

    So you’d need something like:

    
    <div>
    	<?php $field = get_field_object('engineering');
    	$value = $field['value'];
    	$choices = $field['choices'];
    	if( $value ):
    		foreach( $value as $v ):
    			echo $choices[$v]['label'];
    		endforeach;
    		echo '.';
    	endif; 
    	?> 
    </div>