This is my first time posting on here. I've found this site very helpful in the post. I greatly appreciate the dedication the developers have to support each other.
I'm building a testimonial slider in wordpress, for a bit of background knowledge (if required) I've followed; How to Add Rotating Testimonials in WordPress as a starter. Then used Boostrap to code the testimonial slider, Simple Bootstrap Testimonial Carousel (codepen.io/danielmdesigns/pen/yNzJwB)
I'm happy with the HTML/Jquery side. It's the PHP loop that's given me grief. The PHP was taken from the How to Ad Rotating Testimonials in Wordpress from WP Beginner and tried modifying it for my own use.
I've made a comment of the issue in the php code, With my limited PHP knowledge, I'm looking to only release one testimonial per slide, but from trial and error it is to do with the 'php else' statement. Currently in the slider it's releasing all the testimonials stored in the CMS, where it should be releasing one per slider. If you look at the array code, it has a counter on it.
It's the same for endwhile and end if statement, I'm guessing something needs to be added to the php else statement, but unsure what type of if statement.
<div class="carousel slide" id="quote-carousel" data-ride="carousel">
<!-- Bottom Carousel Indicators -->
<ol class="carousel-indicators">
<li data-target="#quote-carousel" data-slide-to="0" class="active"></li>
<li data-target="#quote-carousel" data-slide-to="1"></li>
<li data-target="#quote-carousel" data-slide-to="2"></li>
</ol>
<!-- Carousel Slides / Quotes -->
<div class="carousel-inner">
<?php
$args = array( 'post_type' => 'testimonial', 'posts_per_page' => 10 );
$loop = new WP_Query( $args );
if ( $loop->have_posts() ) : while ( $loop->have_posts() ) : $loop->the_post();
$data = get_post_meta( $loop->post->ID, 'testimonial', true );
static $count = 0;
if ($count == "1") { ?>
<!-- Quote 1 -->
<div class="item active">
<div class="row">
<div class="col-sm-12">
<p><?php the_content(); ?></strong></small>
</div>
</div>
</div>
<!-- Quote 2 -->
<div class="item">
<div class="row">
<div class="col-sm-12">
<!-- this php else is the issue, one testimonial should only release per slide -->
<?php } else { ?>
<p><?php the_content(); ?>
</p>
<small><strong></strong></small>
</div>
</div>
</div>
<?php
$count++; }
endwhile;
endif; ?>
</div>
I know it's possible, I just don't know how. Any guidance would be gratefully received.