I need to create a slider navigation which has one li
for each post. I currently have this code:
<?php
$args = array( 'post_type' => 'slides', 'orderby' => 'menu_order');
$loop = new WP_Query( $args );
?>
<div id="myCarousel" class="carousel slide">
<ol class="carousel-indicators">
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
<?php while ( $loop->have_posts() ) : $loop->the_post(); $x = 1 ?>
<li data-target="#myCarousel" data-slide-to="<?php echo $x ?>"></li>
<?php $x = $x + 1 ?>
<?php endwhile; ?>
</ol>
As I need the first one to stay active.. But this isn't quite working for me