Skip to content

Instantly share code, notes, and snippets.

@raoulwegat
Created March 19, 2015 01:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raoulwegat/ded7ec7892e017b6d3c5 to your computer and use it in GitHub Desktop.
Save raoulwegat/ded7ec7892e017b6d3c5 to your computer and use it in GitHub Desktop.
Wordpress RICG Responsive Images + Advanced Custom Fields in a Gallery + Cycle2
// 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