Last active
May 24, 2016 15:19
-
-
Save mwangepatrick/821de72eddc5ec060fa718507c7b81f0 to your computer and use it in GitHub Desktop.
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 | |
$carousel_images = get_field('home_page_carousel_images'); | |
$imageLimit = 8; | |
if( $carousel_images ): | |
$counter = 0; | |
?> | |
<div class="carousel-inner"> | |
<?php foreach( $carousel_images as $carousel_image ): ?> | |
<?php if($counter<$imageLimit): ?> | |
<?php if ($counter == 0) : ?> | |
<div class="item active"> | |
<?php else : ?> | |
<div class="item"> | |
<?php endif;?> | |
<!-- Set the first background image using inline CSS below. --> | |
<div class="fill" style="background-image:url('<?php echo $carousel_image['url']; ?>');"></div> | |
<div class="carousel-caption"> | |
<h2><?php echo $carousel_image['caption']; ?></h2> | |
<p><a href="#home-content">Find out more</a></p> | |
</div> | |
</div> | |
<?php $counter++;?> | |
<?php endif; ?> | |
<?php endforeach; ?> | |
</div><!-- /carousel-inner --> | |
<?php endif; ?><!-- /end carousel block --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment