Created
May 29, 2018 10:19
-
-
Save solid-pixel/897bb0e1ef6db81e2274f5f1f2abe425 to your computer and use it in GitHub Desktop.
ACF Repeater + Gallery
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="project-gallery"> | |
<?php if( have_rows('gallery_repeater') ): ?> | |
<?php while ( have_rows('gallery_repeater') ) : the_row(); ?> | |
<?php | |
$projGalImgs = get_sub_field('gallery'); | |
$size = 'full'; | |
if( $projGalImgs ): ?> | |
<div class="container"> | |
<div class="row"> | |
<?php foreach( $projGalImgs as $projGalImg ): ?> | |
<div class="col-6"> | |
<?php echo wp_get_attachment_image( $projGalImg['ID'], $size ); ?> | |
</div> | |
<?php endforeach; ?> | |
</div> | |
</div> | |
<?php endif; ?> | |
<?php | |
endwhile; | |
else : | |
// no rows found | |
endif; ?> | |
</div><!-- #project-gallery --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment