Answer the question
In order to leave comments, you need to log in
Embedding a Twitter Bootstrap Carousel Slider in a Wordpress Template
Good afternoon.
I am making a wordpress site. I use the famous Twitter Bootstrap as a framework. In principle, everything is without surprises, only here is the problem with the slider. The fact is that the standard output of the carousel from bootstrap
<div id="myCarousel" class="carousel slide">
<!-- Carousel items -->
<div class="carousel-inner">
<div class="active item">…</div>
<div class="item">…</div>
<div class="item">…</div>
</div>
<!-- Carousel nav -->
<a class="carousel-control left" href="#myCarousel" data-slide="prev">‹</a>
<a class="carousel-control right" href="#myCarousel" data-slide="next">›</a>
</div>
<div id="myCarousel" class="carousel slide">
<?php query_posts('showposts=3&cat=5');?>
<div class="carousel-inner">
<?php while (have_posts()) : the_post(); ?>
<div class="item">
<img src="http://placeimg.com/770/340/people" alt="">
<div class="carousel-caption">
<p><?php the_time('d.m.Y'); ?></p>
<h4><?php the_title(); ?></h4>
</div>
</div>
<?php endwhile; ?>
</div>
<a class="left carousel-control" href="#myCarousel" data-slide="prev">‹</a>
<a class="right carousel-control" href="#myCarousel" data-slide="next">›</a>
</div>
jQuery(document).ready(function($) {
$('.carousel').carousel({
interval: 8000
})
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question