I am trying to create just a testimonial sliders in Bootstrap 4 which will be using custom post types in WordPress but I am struggling to just get the slider to work.
So my question to you is, how do I just have the text in the carousel? When I comment out the image it doesn't work and have searched the web on how to do this but there is not much adoption for BS4 which is frustrating!
<div class="testimonial-Slider">
<div class="container">
<div class="row">
<div id="carouselExampleIndicators" class="carousel slide" 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>
</ol>
<div class="carousel-inner" role="listbox">
<div class="carousel-item active">
<img class="d-block img-fluid" src="http://lorempixel.com/960/300/" alt="First slide">
<div class="carousel-caption">
<h3>Test Headings</h3>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the indu</p>
</div>
</div>
<div class="carousel-item">
<img class="d-block img-fluid" src="http://lorempixel.com/960/300/" alt="Second slide">
<div class="carousel-caption">
<h3>Test Headings</h3>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the indu</p>
</div>
</div>
<div class="carousel-item">
<img class="d-block img-fluid" src="http://lorempixel.com/960/300/" alt="Third slide">
<div class="carousel-caption">
<h3>Test Headings</h3>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the indu</p>
</div>
</div>
</div>
<a class="carousel-control-prev" href="#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="#carouselExampleIndicators" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
</div>
</div>
</div>
I am pretty confident I can get the custom post type and WP Query working fine but it is this that I am having issues with!
Cheers folks :)
.carousel-caption
uses position:absolute
so it doesn't takes up space inside it's parent. The image it's filling the space, giving height.
Use position: relative
. Check all the properties applied to .carousel-caption
, they probably cause some other issue with what you want.
Or just create a new class inside .carousel-item
like .carousel-caption-custom
and only use the css you need on it.