Title: Multiple Loops
Last modified: September 6, 2016

---

# Multiple Loops

 *  [baysah](https://wordpress.org/support/users/baysah/)
 * (@baysah)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/multiple-loops-18/)
 * Hello I am trying to use Bootstrap Carouse to display Testimonials on my webpage.
   Testimonials are made using customs post types. I have the Carouse working, however
   after the last testimonial, it does not go back to the start of the loop and 
   start all over again. Below is my code. what am I doing wrong. Please Help
 *     ```
       <section class="bg-primary page" id="testimonial">
           <h2 class="text-xs-center">TESTIMONIAL</h2>
           <div class="separator-container">
               <div class="separator line-separator">✻</div>
           </div>
           <p class="text-xs-center">See what Clients are saying about our work</p>
           <div id="testimonial-carousel" class="carousel slide" data-ride="carousel">
         <!-- Carousel Inner -->
         <?php $loop = new WP_Query(array('post_type' => 'testimonial' , 'orderby' => 'post_id' , 'order' => 'ASC','posts_per_page'=>'1' )); ?>
         <?php while ($loop ->have_posts()) : $loop->the_post(); ?>
         <div class="carousel-inner" role="listbox">
           <div class="carousel-item active">
             <div class="row">
             <div class="container-fluid">
               <div class="col-md-8 offset-md-2 col-xs-12">
                   <div class="card card-block">
                     <?php
                         $feat_image = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );
                      ?>
                     <img class="img-circle" src="<?php echo "$feat_image"?>" alt="the_post_thumbnail(alt);" />
                     <div class="review">
                        <q cite="<?php the_field('reviewer-name'); ?>"><?php the_field('review'); ?></q>
                     </div>
                     <hr>
                     <div class="reviewer-info">
                       <h4 class="reviewer-name"><?php the_field('reviewer-name'); ?></h4>
                       <p class="reviewer-title"> <span><?php the_field('reviewer-title');?></span> <span class="text-muted"><a class="text-muted" href="<?php the_field('reviewer-company-url'); ?>"><?php the_field('reviewer-company'); ?></a></span> </p>
                     </div>
                   </div>
               </div>
             </div>
         </div>
           </div>
       <?php endwhile; ?>
       <?php
       wp_reset_postdata();
       wp_reset_query();
       ?>
       <?php $loop = new WP_Query(array('post_type' => 'testimonial' , 'orderby' => 'post_id' , 'order' => 'ASC','offset' => '1' )); ?>
       <?php while ($loop ->have_posts()) : $loop->the_post(); ?>
       <div class="carousel-inner" role="listbox">
         <div class="carousel-item ">
           <div class="row">
           <div class="container-fluid">
             <div class="col-md-8 offset-md-2 col-xs-12">
                 <div class="card card-block">
                   <?php
                       $feat_image = wp_get_attachment_url( get_post_thumbnail_id($post->ID) );
                    ?>
                   <img class="img-circle" src="<?php echo "$feat_image"?>" alt="the_post_thumbnail(alt);" />
                   <div class="review">
                      <q cite="<?php the_field('reviewer-name'); ?>"><?php echo the_field('review'); ?></q>
                   </div>
                   <hr>
                   <div class="reviewer-info">
                     <h4 class="reviewer-name"><?php the_field('reviewer-name'); ?></h4>
                     <p class="reviewer-title"> <span><?php the_field('reviewer-title');?> </span> <span class="text-muted"><a class="text-muted" href="<?php the_field('reviewer-company-url'); ?>"><?php the_field('reviewer-company'); ?></a></span> </p>
                   </div>
                 </div>
             </div>
           </div>
       </div>
         </div>
       <?php endwhile;?>
       <?php
       wp_reset_postdata();
       wp_reset_query();
       ?>
         </div><!-- Carousel Inner Close -->
       </div>
       </section>
       ```
   
 * _[[bump ](https://codex.wordpress.org/Forum_Welcome#No_Bumping)moderated]_
    -  This topic was modified 9 years, 7 months ago by [Michael](https://wordpress.org/support/users/alchymyth/).

Viewing 1 replies (of 1 total)

 *  [ThemeSumo](https://wordpress.org/support/users/themesumo/)
 * (@themesumo)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/multiple-loops-18/#post-8174392)
 * Can you post your JS code for the carousel too?
 * Thanks.

Viewing 1 replies (of 1 total)

The topic ‘Multiple Loops’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [ThemeSumo](https://wordpress.org/support/users/themesumo/)
 * Last activity: [9 years, 6 months ago](https://wordpress.org/support/topic/multiple-loops-18/#post-8174392)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
