-
-
Save bhubbard/ac0b3024e685140f8383 to your computer and use it in GitHub Desktop.
Bootstrap carousel with WordPress loop
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
<div class="carousel-inner" role="listbox"> | |
<?php query_posts("posts_per_page=1&post_type=carousel"); ?> | |
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> | |
<div class="item active"> | |
<?php the_post_thumbnail('full', array( 'class' => "img-responsive")); ?> | |
</div> | |
<?php endwhile; ?> | |
<?php else : ?> | |
<?php endif; wp_reset_query();?> | |
<?php query_posts("posts_per_page=2&post_type=carousel&offset=1"); ?> | |
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> | |
<div class="item"> | |
<?php the_post_thumbnail('full', array( 'class' => "img-responsive")); ?> | |
</div> | |
<?php endwhile; ?> | |
<?php else : ?> | |
<?php endif; wp_reset_query();?> | |
</div> <!-- CLOSE CAROUSEL INNER --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment