Created
August 22, 2016 15:38
-
-
Save daveloodts/3887ce6acf0e52933884b2a63126b40e to your computer and use it in GitHub Desktop.
Repeating fields acf
This file contains 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
<?php if( have_rows('verhuur_item') ): ?> | |
<?php while( have_rows('verhuur_item') ): the_row(); | |
// vars | |
$hoofdfotoverhuuritemID = get_sub_field('hoofdafbeelding'); | |
$titelverhuur = get_sub_field('naam_van_verhuur_item'); | |
$contentverhuur = get_sub_field('tekst_verhuuritem'); | |
$imagevh = wp_get_attachment_image_src( $hoofdfotoverhuuritemID, 'thumbnail' ); | |
$imagevhfull = wp_get_attachment_image_src( $hoofdfotoverhuuritemID, 'full' ); | |
?> | |
<div class="verhuuritem row"> | |
<div class="small-12 medium-3 large-3 column"> | |
<div class="foogallery-container foogallery-justified foogallery-lightbox-foobox-free foogallery-justified-loading"> | |
<a href="<?php echo $imagevhfull[0]; ?>"><img class="verhfoto" src="<?php echo $imagevh[0]; ?>" /></a> | |
</div> | |
</div> | |
<div class="small-12 medium-9 large-9 column"> | |
<h3><?php echo $titelverhuur; ?></h3> | |
<?php echo $contentverhuur; ?> | |
<div class="fotogallerij"> | |
<?php | |
$images = get_sub_field('gallerij_item'); | |
if( $images ): ?> | |
<div class="foogallery-container foogallery-justified foogallery-lightbox-foobox-free foogallery-justified-loading"> | |
<?php foreach( $images as $image ): ?> | |
<a href="<?php echo $image['url']; ?>"><img src="<?php echo $image['sizes']['thumbnail']; ?>" alt="<?php echo $image['alt']; ?>" /></a> | |
<?php endforeach; ?> | |
</div> | |
<?php endif; ?> | |
</div> | |
</div> | |
</div> | |
<?php endwhile; ?> | |
<?php endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment