Skip to content

Instantly share code, notes, and snippets.

@reidelliott
Last active April 5, 2016 18:47
Show Gist options
  • Save reidelliott/4eb52b54411d80e40f05d33bed6122d8 to your computer and use it in GitHub Desktop.
Save reidelliott/4eb52b54411d80e40f05d33bed6122d8 to your computer and use it in GitHub Desktop.
Loop
<div class="carousel-inner" role="listbox">
<?php
$i = 0; while ( $web_loop->have_posts() ) : $web_loop->the_post();
$count = $web_loop->post_count;
// $link = get_field('link');
if ( has_post_thumbnail() ) {
$image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'medium' );
}
?>
<?php if ($i%15==0) { ?>
<div class="item <?php if($i == 0) { echo 'active'; } ?>">
<?php } ?>
<div id="press-item-<?= $i; ?>" class="press-item col-sm-15" style="background-image: url('<?= $image[0]; ?>'); background-position: center center; background-repeat: no-repeat;">
<div class="press-item-content">
<?php if ($link) { echo '<a href="' . $link . '" target="_blank">'; } ?>
<div class="press-item-inner hidden-xs">
<?php the_content(); ?>
</div>
<?php if ($link) { echo '</a>'; } ?>
</div>
</div> <!-- .press-item -->
<?php if ( $i%15==14 || $count==$i-14) { ?>
</div> <!-- .item -->
<?php } $i++; endwhile; ?>
</div> <!-- .carousel-inner -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment