1
我有以下代碼安裝程序,可以從WordPress獲取粘性帖子並將它們放入Bootstrap Carousel中。將縮略圖添加到Bootstrap Carousel for WordPress查詢
我該如何去水平添加一個響應式縮略圖導航行,以突出顯示活動縮略圖並將其限制爲6左右?
我有以下代碼安裝程序,可以從WordPress獲取粘性帖子並將它們放入Bootstrap Carousel中。將縮略圖添加到Bootstrap Carousel for WordPress查詢
我該如何去水平添加一個響應式縮略圖導航行,以突出顯示活動縮略圖並將其限制爲6左右?
像這樣:
<div id="myCarousel" class="carousel slide">
<div class="carousel-inner">
<?php
$i = 0;
$the_query = new WP_Query(array(
'post__in' => get_option('sticky_posts'),
'ignore_sticky_posts' => 1,
'posts_per_page' => 7
));
while ($the_query->have_posts()) : $the_query->the_post();
$i++;
?>
<div class="item <?php if($i == 1) { echo 'active'; }?>">
<?php the_post_thumbnail('large');?>
<div class="carousel-caption">
<h4><?php the_title();?></h4>
<p><?php the_excerpt();?></p>
</div>
</div><!-- item active -->
<?php
endwhile;
wp_reset_postdata();
?>
</div><!-- carousel-inner -->
<a class="left carousel-control" href="#myCarousel" data-slide="prev">‹</a>
<a class="right carousel-control" href="#myCarousel" data-slide="next">›</a>
</div><!-- #myCarousel -->
「下面的代碼」? – 2015-02-20 17:16:04