Support

Account

Home Forums Front-end Issues Show an entire specific field group in frontend Reply To: Show an entire specific field group in frontend

  • Hi Elliot,

    Thanks for this code, its working good for input fields but how can I get values from checkboxes, now it just displays – Array

    I modified the code a bit, to check if value is an array, but it is giving me a Field Name (ugly) not the Field Label

    <?php 
    
    $group_ID = 327;
    
    $fields = array();
    $fields = apply_filters('acf/field_group/get_fields', $fields, $group_ID);
    
    if( $fields )
    {
        foreach( $fields as $field )
        {
            $value = get_field( $field['name'], 'user_' . $author->ID );
            
            echo '<dl>';
                echo '</br><dt>' . $field['label'] . '</dt>';
    
            if(is_array($value))   {
                foreach($value as $singleValue){
                   echo '<dd>' .$singleValue . '</dd> ';
    
                }
    
            } else {
                echo '<dd>' .$value . '</dd> ';
            }
    
                
    
            echo '</dl>';
        }
    }
    
    ?>