Adding a carousel to your page
Bootstrap's Carousel component enables you to create a slideshow for cycling through images or slides of text. Of course, you can also add a carousel to your theme.
First you should upload your image to the assets/images/slides
directory of your theme. All images should have the same width and height.
As an example, we have added three images into the assets/images/slides
directory called slide1.jpg
, slide2.jpg
and slide3.jpg
. These images are released in the CC0 Public Domain and you can find them on Pixabay (https://pixabay.com/).
In the next section, we'll use PHP to create the desired HTML output of our template files. If you are not familiar with PHP yet, the official website can be found at the following URL: http://php.net/. To learn the basics of PHP you can visit Packt's PHP Tech Page at https://www.packtpub.com/tech/php.
Now you can create a new template in the parts directory. You may call it component-carousel.php
.
In the component-carousel.php
, you...