Support

Account

Home Forums Front-end Issues exclude field on fields array Reply To: exclude field on fields array

  • Hello and thank you for your answer,
    I tried this but I think I did wrong the code,
    Can you see when you have time?
    thank you

    <?php
    $group_ID = 30109;
    $fields = array();
    $fields = apply_filters('acf/field_group/get_fields', $fields, $group_ID);
    
    $exclude = array('field_5919f45752917', 'field_5919f46252918', 'field_5919f46a52919');
    
    if( $fields )
    {
    echo '<div class="col-sm-6">';
    echo '<h3>Description:</h3>';
        echo '<ul class="list-unstyled">';
      foreach( $fields as $field_name => $field ) {
      if (in_array($field['key'], $exclude) {
      {
        $value = get_field( $field['name'] );
        if ($field['choices']){
          $map = array(
           'yes' => '<i class="icon-ok"></i>'       
           );
          $value = $map[ $value ];
        } else {
        }
        if( $value && $value != 'no') {
          echo '<li>' . $field['label'] . '&nbsp;' . $value . '</li>';
      }
        continue;
      }
    }
      echo '</ul>';
    echo '</div>';
    }
    ?>