我已经在Boostrap中制作了一个轮播,并粘贴到了我的wordpress主题中,但幻灯片却叠了起来。我究竟做错了什么()

【我已经在Boostrap中制作了一个轮播,并粘贴到了我的wordpress主题中,但幻灯片却叠了起来。我究竟做错了什么()】因此, 我用Bootstrap制作了一个轮播, 并将其粘贴到我的wordpress主题中。我已经尝试将其与一些WP代码结合起来, 希望你们能对我有所帮助。

< div class="carousel-inner text-uppercase font-weight-bold"> < ?php $the_query = new WP_Query( 'posts_per_page=4' ); ?> < ?php while ($the_query -> have_posts()) : $the_query -> the_post(); ?> < div class="carousel-item active"> < a href="http://www.srcmini.com/< ?php the_permalink() ?>"> < img src="http://www.srcmini.com/< ?php the_post_thumbnail_url('wide'); ?> " class="d-block w-100"> < h2 class="carousel-caption bg-black w-auto font-weight-bold font-italic"> < ?php the_title(); ?> < /h2> < /a> < /div> < ?php endwhile; wp_reset_postdata(); ?> < /div> < a class="carousel-control-prev" href="http://www.srcmini.com/#carouselExampleIndicators" role="button" data-slide="prev"> < span class="carousel-control-prev-icon" aria-hidden="true"> < /span> < span class="sr-only"> Previous< /span> < /a> < a class="carousel-control-next" href="http://www.srcmini.com/#carouselExampleIndicators" role="button" data-slide="next"> < span class="carousel-control-next-icon" aria-hidden="true"> < /span> < span class="sr-only"> Next< /span> < /a> < /div>

#1确保你包含jQuery, 检查控制台是否有错误。
#2我知道了
< div id="carouselExampleIndicators" class="carousel slide pt-4" data-ride="carousel"> < ol class="carousel-indicators"> < li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"> < /li> < li data-target="#carouselExampleIndicators" data-slide-to="1"> < /li> < li data-target="#carouselExampleIndicators" data-slide-to="2"> < /li> < li data-target="#carouselExampleIndicators" data-slide-to="3"> < /li> < /ol> < div class="carousel-inner text-uppercase font-weight-bold"> < ?php $the_query = new WP_Query(array('posts_per_page'=> 1, 'tag'=> 'favorite')); ?> < ?php while ($the_query -> have_posts()) : $the_query -> the_post(); ?> < div class="carousel-item active"> < a href="http://www.srcmini.com/< ?php the_permalink() ?>"> < img src="http://www.srcmini.com/< ?php the_post_thumbnail_url('wide'); ?> " class="d-block w-100"> < h2 class="carousel-caption bg-black w-auto font-weight-bold font-italic"> < ?php the_title(); ?> < /h2> < /a> < /div> < ?php endwhile; wp_reset_postdata(); ?> < ?php $the_query = new WP_Query(array('posts_per_page'=> 3, 'tag'=> 'favorite', 'offset'=> 1)); ?> < ?php while ($the_query -> have_posts()) : $the_query -> the_post(); ?> < div class="carousel-item"> < a href="http://www.srcmini.com/< ?php the_permalink() ?>"> < img src="http://www.srcmini.com/< ?php the_post_thumbnail_url('wide'); ?> " class="d-block w-100"> < h2 class="carousel-caption bg-black w-auto font-weight-bold font-italic"> < ?php the_title(); ?> < /h2> < /a> < /div> < ?php endwhile; wp_reset_postdata(); ?> < /div> < a class="carousel-control-prev" href="http://www.srcmini.com/#carouselExampleIndicators" role="button" data-slide="prev"> < span class="carousel-control-prev-icon" aria-hidden="true"> < /span> < span class="sr-only"> Previous< /span> < /a> < a class="carousel-control-next" href="http://www.srcmini.com/#carouselExampleIndicators" role="button" data-slide="next"> < span class="carousel-control-next-icon" aria-hidden="true"> < /span> < span class="sr-only"> Next< /span> < /a> < /div>

    推荐阅读