Support

Account

Home Forums ACF PRO Select Field get multipe value AND label Reply To: Select Field get multipe value AND label

  • the way to do that the code needs to look something like this:

    
    $field_name = "md_services";
    $values = get_field($field_name);
    $field = get_field_object($field_name);  
    
    if( $values ){
      foreach( $values as $value ){  
        $icon = '<span class="md-service-img"> <img src="' . 
                 get_stylesheet_directory_uri() . '/images/icons/' . 
                 $value . '.png"><span class="md-service-desc">' . 
                 $field['choices'][$value] . '</span></span>'; 
        echo $icon;
      }
    }
    

    Recently I have created some function that can do this as well and added them to my library of ACF filters and functions https://github.com/Hube2/acf-filters-and-functions/blob/master/acf-field-label-functions.php