I want to display 8 posts in twoeach carousel slides, that mean 4 post in each slide. i'm using a loop to display post but the problem is, it is showing one post in one slide and hence displaying 8 slides.
<div class="carousel-inner">
<?php
query_posts("posts_per_page=8&post_type=post&category_name=Hector");
if ( have_posts() ) :
$i = 1;
while ( have_posts() ) : the_post();
?>
<div class="carousel-item <?php if ( $i == 1 ){ echo 'active'; } ?>">
<div class="col-md-3">
<a href="/">
<img src="<?php the_post_thumbnail_url(); ?>"alt="<?php the_title() . ' feature image'; ?>" style="max-width:100%;">
<h3><?php the_title(); ?></h3>
</a>
</div>
<?php
if($i % 4 == 0):
?>
</div>
<?php
endif;
$i++;
endwhile;
endif;
?>
</div>