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?

1 Answer 1

0

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.