Last active
April 5, 2016 18:47
-
-
Save reidelliott/4eb52b54411d80e40f05d33bed6122d8 to your computer and use it in GitHub Desktop.
Loop
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
<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