Support

Account

Home Forums Front-end Issues gallery Array Reply To: gallery Array

  • I do not really understand
    besides replacing it THE_NAME_OF_YOUR_GALLERY_FIELD with the name of the gallery field, album, something else to be done?
    I do not understand why it is so complicated
    it does not display any existing or uploaded photos

    <?php
      $fields = get_fields($post->ID);
      if ($fields) {
        ?>
          <ul>
            <?php 
              foreach ($fields as $name => $value) {
                ?>
                  <li>
                    <b><?php echo $name; ?></b>
                    <?php 
                      if ($name == 'album') {
                        // do something special for gallery fields
                      } else {
                        // basic field
                        echo $value;
                      }
                    ?>
                  </li>
                <?php 
              } // end foreach fields
            ?>
          </ul>
        <?php 
      } // end if fields
    ?>