Last active
March 23, 2018 21:44
-
-
Save brentini/e9315c4d4f1c51a88bf0dd2b1bdde2b6 to your computer and use it in GitHub Desktop.
Slider wordpress+bootstrap #wordpress
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
<!--Carrossel--> | |
<div class="row"> | |
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel"> | |
<!-- Wrapper for slides --> | |
<div class="carousel-inner" role="listbox"> | |
<?php wp_reset_query(); ?> | |
<?php query_posts('category_name=slider&posts_per_page=5'); ?> | |
<?php $cont = 0; ?> | |
<?php while (have_posts()) : the_post(); ?> | |
<div class="item <?php if($cont == 0): echo"active"; ?><?php endif; ?>"> | |
<?php if (has_post_thumbnail( $post->ID ) ): ?> | |
<?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' ); ?> | |
<img src="<?php echo $image[0]; ?>" alt=""> | |
<div class="backLinearSlide"> | |
<div class="carousel-caption"> | |
<div class="retranca"><?php exclude_post_categories($excl='1237', $spacer=' ') ?></div> | |
<h2 class="titleBanner"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2> | |
</div> | |
</div> | |
</div> | |
<?php $cont++; ?> | |
<?php endif; ?> | |
<?php endwhile;?> | |
<?php wp_reset_query(); ?> | |
</div> | |
<!-- Controls --> | |
<a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev"> | |
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span> | |
<span class="sr-only">Previous</span> | |
</a> | |
<a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next"> | |
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span> | |
<span class="sr-only">Next</span> | |
</a> | |
</div> | |
</div> | |
<!--Carrossel--> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment