Support

Account

Home Forums Front-end Issues how to display each gallery image in category page Reply To: how to display each gallery image in category page

  • problem solve. i made it. code bellow

          <?php 
    	while ( have_posts() ) :
    	the_post();
    	?>
          <h2><a href="<?php  the_permalink(); ?>">
            <?php  the_title(); ?>
            </a></h2>
          <?php
    $images = get_field('gallery_picture');
    $max = 5;
    $i = 0;
    
    if( $images ): ?>
          <ul>
            <?php foreach( $images as $image ): $i++; ?>
            <?php if( $i > $max){ break; } ?>
            <li> <img src="<?php echo $image['sizes']['thumbnail']; ?>" alt="<?php echo $image['alt']; ?>" /> </li>
            <?php endforeach; ?>
          </ul>
          <?php endif; ?>
          <a href="<?php  the_permalink(); ?>" class="info">Gallery</a> </div>
        <?php  endwhile; ?>