我已经在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>
推荐阅读
- 我只想在WordPress的特定页面上添加自定义短代码
- Visual Composer是否与divi兼容( [关闭])
- 这样使用”自定义字段”更改WooCommerce中的”添加到卡片文本”是否很好()
- 类似这样的网站在wordpress上可以实现吗()
- WordPress style.css模板元素的语法在任何地方都可用吗()
- 使用 Nginx 提供 DDNS 服务(前篇)
- 定制个机器人帮你和Ta聊天
- SpringCloud升级之路2020.0.x版-26.OpenFeign的组件
- 交换机的基本原理与配置