Carousel don′t 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">‹</a> <a class="carousel-control right" href="#myCarousel" data-slide="next">›</a> </div> </div> </section> <?php get_footer();
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Carousel don′t work’ is closed to new replies.