我已经在这方面工作了一段时间,我有四个帖子显示在旋转木马中,这很好。单击旋转木马中的下一张幻灯片时,将显示相同的四个立柱
知道我做错了什么吗?
谢谢
<div id="blog" class="carousel slide carousel-sync" data-ride="carousel" data-interval="false">
<div class="carousel-inner blog">
<?php $query = new WP_Query(array(\'post_type\' => \'post\', \'posts_per_page\' => -1,)); while ( $query->have_posts() ) : $query->the_post(); ?>
<div class="item" id="<?php echo $post->ID;?>" >
<div class="col-md-6 nopadding view view-ninth" style="padding-left:4px; padding-right:4px;">
<?php the_post_thumbnail(\'large\'); ?>
<div class="content">
<h2><?php the_title() ;?></h2>
<p><?php $excerpt = get_the_excerpt(); echo string_limit_words($excerpt,15) . \'...\'; ?></p>
<a href="#" class="info">Read More</a>
</div>
</div>
</div>
<div class="item" id="<?php echo $post->ID;?>" >
<div class="col-md-6 nopadding view view-ninth" style="padding-left:4px; padding-right:4px;">
<?php the_post_thumbnail(\'large\'); ?>
<div class="content">
<h2><?php the_title() ;?></h2>
<p><?php $excerpt = get_the_excerpt(); echo string_limit_words($excerpt,15) . \'...\'; ?></p>
<a href="#" class="info">Read More</a>
</div>
</div>
</div>
<div class="item" id="<?php echo $post->ID;?>" >
<div class="col-md-6 nopadding view view-ninth" style="padding-left:4px; padding-right:4px;">
<?php the_post_thumbnail(\'large\'); ?>
<div class="content">
<h2><?php the_title() ;?></h2>
<p><?php $excerpt = get_the_excerpt(); echo string_limit_words($excerpt,15) . \'...\'; ?></p>
<a href="#" class="info">Read More</a>
</div>
</div>
</div>
<div class="item" id="<?php echo $post->ID;?>" >
<div class="col-md-6 nopadding view view-ninth" style="padding-left:4px; padding-right:4px;">
<?php the_post_thumbnail(\'large\'); ?>
<div class="content">
<h2><?php the_title() ;?></h2>
<p><?php $excerpt = get_the_excerpt(); echo string_limit_words($excerpt,15) . \'...\'; ?></p>
<a href="#" class="info">Read More</a>
</div>
</div>
</div><!-- end item -->
<?php endwhile; wp_reset_postdata(); ?>
</div>
</div>
<a class="carousel-control right " href="#blog" data-slide="next" >R</a>
<a class="carousel-control left " href="#blog" data-slide="prev" >L</a>
</div>
<?php get_sidebar( ); // right ?>
</div>
<script>
jQuery(document).ready(function($){
$("#blog").find(\'.item:nth-child(4n-7)\').addClass(\'active\');
$(\'.customslider\').each(function(){
$(this).find(\'.item:nth-child(4n-7)\').addClass(\'active\');
})
})
</script>