Created
March 19, 2015 01:51
-
-
Save raoulwegat/ded7ec7892e017b6d3c5 to your computer and use it in GitHub Desktop.
Wordpress RICG Responsive Images + Advanced Custom Fields in a Gallery + Cycle2
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
// Responsive Slideshow in Wordpress | |
// https://github.com/ResponsiveImagesCG/wp-tevko-responsive-images | |
// http://www.advancedcustomfields.com/pro | |
// http://jquery.malsup.com/cycle2/ | |
$images = get_field('gallery'); | |
if( $images ): ?> | |
<div class="cycle-slideshow" | |
data-cycle-timeout=0 | |
data-cycle-caption=".caption" | |
data-cycle-caption-template="{{alt}}" | |
data-cycle-swipe=true | |
data-cycle-swipe-fx=scrollHorz | |
data-cycle-caption-plugin="caption2" | |
data-cycle-autoHeight="700:466" | |
> | |
<div class="cycle-prev"></div> | |
<div class="cycle-next"></div> | |
<div id="progress"></div> | |
<?php foreach( $images as $image ): ?> | |
<?php $srcset = tevkori_get_srcset_string( $image['id'], 'medium' ); ?> | |
<img src="<?php echo $image['sizes']['medium']; ?>" <?php echo $srcset; ?> alt="<?php echo $image['caption']; ?>"> | |
<?php endforeach; ?> | |
</div> | |
<?php endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment