Title: Carousel don´t work
Last modified: August 21, 2016

---

# Carousel don´t work

 *  [Rafael Pires](https://wordpress.org/support/users/rafaelpiressp/)
 * (@rafaelpiressp)
 * [13 years ago](https://wordpress.org/support/topic/carousel-dont-work/)
 * I made a new archive page for a custom post type but the carousel doesn’t work,
   apparently the JS isn’t loaded it right.
    I followed all instructions from bootstrap
   site.
 * That´s my code.
 *     ```
       get_header();
   
       global $post;
   
       $args = array(
           'post_type' => 'projeto_post',
           'order_by' => 'rand',
           'meta_query' => array(
               array(
                   'key' => 'cdi_destaque',
                   'value' => 1,
               )
           )
        );
   
       $get_cdi_destaques = get_posts( $args );
       $total_cdi_destaques = count($get_cdi_destaques);
       ?>
   
       <section id='cdi_destaque_projeto'>
           <div id='myCarousel' class='carousel slide'>
               <ol class='carousel-indicators'>
                   <?php
                   for ($slide = 1; $slide <= $total_cdi_destaques; $slide++) {
                       $x=$slide-1;
                       echo '<li data-target="#myCarousel" data-slide-to="'.$x.'"';
                       if ($slide==1) {
                           echo 'class="active"';
                       }
                       echo '></li>';
                   }
                   ?>
               </ol>
               <div class='crousel-inner'>
                   <?php
                   $contador=1;
                   foreach ($get_cdi_destaques as $post) {
                       setup_postdata($post);
                       if ($contador==1) {
                           echo '<div class="active item">';
                       }else{
                           echo '<div class="item">';
                       }
                       the_post_thumbnail();
                       ?>
                       <div class='carousel-caption'>
                           <h4><?php the_title(); ?></h4>
                           <p><?php the_excerpt(); ?></p>
                       </div>
                   <?php } ?>
               </div>
               <div>
                   <!-- Carousel nav -->
                   <a class="carousel-control left" href="#myCarousel" data-slide="prev">&lsaquo;</a>
                   <a class="carousel-control right" href="#myCarousel" data-slide="next">&rsaquo;</a>
               </div>
           </div>
       </section>
   
       <?php get_footer();
       ```
   
 * [http://wordpress.org/extend/themes/the-bootstrap/](http://wordpress.org/extend/themes/the-bootstrap/)

Viewing 1 replies (of 1 total)

 *  [maxwellss](https://wordpress.org/support/users/maxwellss/)
 * (@maxwellss)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/carousel-dont-work/#post-3814090)
 * Hey there,
 * I had this problem too. To solve it, update the carousel js which is within /
   js/bootstrap.js in your theme’s folder. I forget which version ships with the
   theme, but it’s older, and it doesn’t work. Get the newer version of carousel.
   js from [github](https://github.com/twitter/bootstrap/blob/master/js/bootstrap-carousel.js),
   and dump it into your /js/bootstrap.js in your theme folder. Your carousel should
   work.

Viewing 1 replies (of 1 total)

The topic ‘Carousel don´t work’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/the-bootstrap/2.0.3/screenshot.
   png)
 * The Bootstrap
 * [Support Threads](https://wordpress.org/support/theme/the-bootstrap/)
 * [Active Topics](https://wordpress.org/support/theme/the-bootstrap/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/the-bootstrap/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/the-bootstrap/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [maxwellss](https://wordpress.org/support/users/maxwellss/)
 * Last activity: [12 years, 11 months ago](https://wordpress.org/support/topic/carousel-dont-work/#post-3814090)
 * Status: not resolved