Created
May 20, 2016 16:26
-
-
Save rugor/faf92d1b53a76607310fe5d3568a1902 to your computer and use it in GitHub Desktop.
PHP: WordPress ACF Flickity Fullscreen
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 | |
$gallery_images = get_field('gallery'); | |
?> | |
<div class="gallery js-flickity" data-flickity-options='{ "autoPlay": 6000, "pageDots": false, "imagesLoaded": false, "prevNextButtons": false, "lazyLoad": false, "accessibility": false, "draggable": false, "wrapAround": true }'> | |
<?php foreach($gallery_images as $image) { | |
echo '<div class="cell-full" style="width: 100%; height: 100%; background: url(' . $image['image'] . ') no-repeat center center; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover;" ></div>'; | |
} ?> | |
</div><!-- /gallery /js-flickity --> | |
<?php } ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment