Home Forums Add-ons Gallery Field First Image In Gallery As Featured Image Reply To: First Image In Gallery As Featured Image

  • Another question, how do I remove the first image from the gallery, I get the first image repeating itself.

    <?php if ( have_rows('apartamento_1_alcoba') ): ?>
    <div id="img-module-slider-1" class="vivienda-slider">
      <?php while( have_rows('apartamento_1_alcoba') ) : the_row();
        $icono_1_alcoba = get_sub_field('icono');
        $gallery = get_sub_field('lightbox');
        $id_1_alcoba = get_sub_field('plano_id');
      <section data-featherlight-gallery data-feather-filter="a">
        <a class="apt-gallery-<?php echo $id_1_alcoba ?>" href="<?php echo $gallery[0]['url'] ?>">
          <img class="module-img-size" src="<?php echo $icono_1_alcoba['url'] ?>" alt="<?php echo $icono_1_alcoba['alt'] ?>">
        <?php if ( $gallery ): ?>
          <?php foreach ( $gallery as $image ): ?>
            <a class="apt-gallery-<?php echo $id_1_alcoba ?>" href="<?php echo $image['url'] ?>" alt="<?php echo $image['alt']?>"></a>
          <?php endforeach; ?>
        <?php endif; ?>
      <?php endwhile; ?>
    <?php endif; ?>