WordPress latest posts carousel

I try to get latest WordPress posts in carousel, I received no error but also no results!

here is the code I’m using :

<div class="jumbotron">
                    <div id="carousel-example-generic" class="carousel slide" data-ride="carousel">


                    $my_query = new WP_Query();
                  $do_not_duplicate = $post->ID;
                  echo '<ol class="carousel-indicators">';
                  while ($my_query->have_posts()) : $my_query->the_post();
                    echo '<li data-target="#carousel-example-generic"data-slide-to="'; echo $x; $x++; echo '"';
                    if( $x==0 ){ echo'class="active" ';  } echo'></li>';
                  endwhile ;
                  echo' </ol>';
              <!-- Carousel items -->
              <div class="carousel-inner">
            <?php $x==0; while ($my_query->have_posts()) : $my_query -> the_post(); ?>

                <div class="<?php if($x==0){echo 'active item';}else{echo 'item';} ?>">
                    <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php echo get_the_post_thumbnail($id, 'sliderimg'); ?></a>
        <div class="carousel-caption"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></div>

                <?php endwhile; ?>

              <!-- Carousel nav -->
                <a class="left carousel-control" href="#carousel-example-generic" data-slide="prev">
                    <span class="glyphicon glyphicon-chevron-left"></span>
                <a class="right carousel-control" href="#carousel-example-generic" data-slide="next">
                    <span class="glyphicon glyphicon-chevron-right"></span>
              <?php wp_reset_query(); ?>

Here is my JS:

jQuery(document).ready(function($) {
        interval: 1000  

Please help me if you have any idea.

Sorry guys but here is dummy text just to this site let me post my question! my question was simple and clear i don’t know what more should i say till be able to post my question!.

Read more here: WordPress latest posts carousel

Leave a Reply

Your email address will not be published. Required fields are marked *