0

I'm using a Wordpress bootstrap theme and I'm having trouble clearing after each row. Some of the columns aren't cleared so they have spaces between them.

This is the code I'm using to show my custom post type "movie"

<?php 

//Define your custom post type name in the arguments

$args = array('post_type' => 'movie', 'posts_per_page'=>'100', 'order'=>'ASC') ;

//Define the loop based on arguments

$loop = new WP_Query( $args );

//Display the contents

while ( $loop->have_posts() ) : $loop->the_post();
?>
<div class="col-lg-3 col-md-3 col-sm-4 col-xs-6" style="padding-bottom:20px;"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_post_thumbnail( 'movie-poster' );  ?></a><?php the_title(); ?><br><em><?php the_date(); ?></em></div>
<?php endwhile;?>

I believe I need to clear it after every 4th or 3rd or 2nd (depending on screen) post. How can I add that into that code above?

morart
  • 11
  • 3

1 Answers1

0

I think you are looking for a grid layout of your posts. Check this question: Wordpress Loop posts in Bootstrap 3 grid layout.

Community
  • 1
  • 1
thomas_inckx
  • 430
  • 4
  • 18