-
-
Save dashdanilo/fbb4229651123c10b7e0 to your computer and use it in GitHub Desktop.
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
<?php if ( get_field( 'slides' ) ) : // repeater field ?> | |
<ul class="slider"> | |
<?php while ( the_repeater_field( 'slides' ) ) : | |
$image = get_sub_field( 'slide' ); // sub-field image ID | |
$slide = wp_get_attachment_image_src( $image, 'slides' ); | |
$alt = get_post_meta( $image, '_wp_attachment_image_alt', true ); | |
?> | |
<li><img src="<?php echo $slide[0]; ?>" alt="<?php echo $alt; ?>"></li> | |
<?php endwhile; ?> | |
</ul> | |
<?php endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment