<?php if( have_rows('social_media', 'option') ): ?> <ul class="social-media"> <?php while( have_rows('social_media', 'option') ): the_row(); $socialIcon = get_sub_field('icon' , 'option'); $socialLink = get_sub_field('link' , 'option'); ?> <li> <a href="<?php echo $socialLink; ?>"> <img src="<?php echo $socialIcon; ?>"> </a> </li> <?php endwhile; ?> </ul> <?php endif; ?>