When First Item is active then Use that code
<?php
global $post;
$args = array( 'numberposts' => -1, 'category' => 3 );
$posts = get_posts( $args );
$i=0;
foreach( $posts as $post ): setup_postdata($post);
$url = wp_get_attachment_url( get_post_thumbnail_id($post->ID, 'thumbnail') );
?>
<div class="item <?php if($i==0) { ?> active <?php } else { } ?>" style="background-image: url('<?php echo $url ?>')" >
<div class="carousel-caption">
<div class="animated bounceInRight">
<h2><?php the_title(); ?></h2>
<p><?php the_content(); ?></p>
</div>
</div>
</div>
<?php $i++; endforeach; ?>
</div>
Comments
Post a Comment