Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress From Bootstrap to WordPress Add Bootstrap Components to WordPress Theme Finishing Up Our Bootstrap Slideshow Carousel

Dawn Foster
Dawn Foster
1,899 Points

How to install bootstrap carousel on the static front-page.php without using blog posts

I have a static full-width front-page that I want to have a large carousel rotating about 8 images in the header.

I tried just using the code from this project, and since I still have the blog posts that have images, it is working. However, I don't want to use blog posts for this.. I just want to have separate images to cycle through.. nothing to do with blog postings that can be picked up if I create a blog page later on.

What should I do? Install a bootstrap carousal plug-in? Or use short-codes? Or use custom posts that can be used in the carousal? I've played around, and just can't figure out the best method to use.

Can you please point me to a tutorial for this.. or tell me what I need for the front-page.php, functions.php, and WP admin to get this to work.

Thanks, Dawn

1 Answer

Dawn Foster
Dawn Foster
1,899 Points

I figured out one way to do it.. that is very easy and nice solution.

  1. Download and activate the "CPT Bootstrap Carousel" plugin.

  2. Then just add the following [image-carousel] shortcode in a Page or Post:

        ```php
       <?php echo do_shortcode('[image-carousel]'); ?>
        ```    
    
  3. Create new items in the Carousel post type, uploading a Featured Image for each

Hope this helps others wanting to do the same.

(for more info on the plugin, read here: https://wordpress.org/plugins/cpt-bootstrap-carousel/)

Dharmesh Sheth
Dharmesh Sheth
2,547 Points

Do i add the above code on the function.php,or on front-page.php?