Support

Account

Home Forums Front-end Issues Display field groups in separate lists Reply To: Display field groups in separate lists

  • Thanks again – I’ve implemented the code successfully, and also added an additional line of code so that empty fields do not display. Here’s the final code.

                      <ul>
                      <?php
    
                      $fields = get_field_objects();
                      if( $fields ) {
    
                      foreach ($fields as $field_name => $field) {
                        if ($field['parent'] == '303') {
                          if ($field['value'] == '') {
                          continue;
                        }
                            echo '<li><b>';
                            echo $field['label'] . ": </b>";
                            echo $field['value'];
                            echo '</li>';
                        }
                        }
                      }
                      ?>
                      </ul>