Tôi đã tích hợp băng chuyền bootstrap vào wordpress của mình. Các trang trình bày sẽ được lấy từ các bài đăng sẽ được gắn thẻ là "nổi bật" vì vậy chỉ 5 bài đăng mới nhất được nhập vào "nổi bật" sẽ được hiển thị.Tích hợp băng chuyền Bootstrap vào WordPress mà không cần plugin
Dưới đây là mã của tôi:
<div id="carousel-captions" class="carousel slide bs-docs-carousel hidden-xs">
<ol class="carousel-indicators">
<li data-target="#carousel-captions" data-slide-to="0" class="active"></li>
<li data-target="#carousel-captions" data-slide-to="1" class=""></li>
<li data-target="#carousel-captions" data-slide-to="2" class=""></li>
<li data-target="#carousel-captions" data-slide-to="3" class=""></li>
<li data-target="#carousel-captions" data-slide-to="4" class=""></li>
</ol>
<div class="carousel-inner">
<?php $the_query = new WP_Query('tag=featured&orderby=date&posts_per_page=5'); ?>
<?php if ($the_query->have_posts()) : ?>
<?php while ($the_query->have_posts()) : $the_query->the_post(); ?>
<div class="item">
<a href="<?php the_permalink() ?>">
<img src="<?php the_field('header_banner', $post_id); ?>" alt="">
<div class="carousel-caption">
<h3><?php the_field('year', $post_id); ?></h3><span class="name">Make<br><?php $category = get_the_category(); echo $category[0]->cat_name; ?></span><hr>
<p><?php the_field('mileage', $post_id); ?> Miles | <?php the_field('exterior_color', $post_id); ?> Color<br><br><?php echo homepage_carousel_excerpt(15); ?></p><span class="btn btn-default">Details →</span>
</div></a>
</div>
<?php endwhile; ?>
<?php wp_reset_postdata(); ?>
<?php else: ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<?php endif; ?>
</div>
<a class="left carousel-control" href="#carousel-captions" data-slide="prev">
<span class="icon-prev"></span>
</a>
<a class="right carousel-control" href="#carousel-captions" data-slide="next">
<span class="icon-next"></span>
</a>
</div>
Vấn đề là Nó không trượt vì lớp "hoạt động" không hoạt động tĩnh.
Tôi làm cách nào để sửa lỗi này?
Cảm ơn
Hey @feub ---- các chỉ số Carousel dừng lại ở 10 --- bất kỳ ý tưởng nơi để tìm ra code để thay đổi điều này (bootstrap.js) Tôi nghĩ rằng tôi đã tạo một bài đăng cách đây vài tuần để giải quyết vấn đề này và nhận được một huy hiệu Tumbleweed không có câu trả lời. – plushyObject