I have problem with showing posts in more than one row, if I have more than 3 posts. How can I set more rows if I have more posts? For example, if I have 7 posts, I should have 3 rows. Can I do that? If yes, how?

<div class="row-fluid shop-products" >
    <ul class="thumbnails" >
    <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
        <li class="item span4" >
            <div class="thumbnail" id="archive_thumbnail">
                <a href="<?php the_permalink();?>" class="image">
                    <img src="<?php the_field( 'photo' ) ?>" alt="" id="archive_photo">
                    <span class="frame-overlay"></span>
                    <span class="price"><?php the_field( 'price_from' ) ?></span>
                <div class="inner notop nobottom">
                    <h4 class="title"><?php the_field( 'title' )?></h4>
                    <p class="description"><?php the_field( 'content' ) ?></p>
            <div class="inner darken notop">
                <a href="#" class="btn btn-add-to-cart">Add<i class="icon-shopping-cart"></i></a>
    <?php endwhile; ?>
  • what is the result if you have more than three posts? what is the CSS?
    – Michael
    Dec 24, 2015 at 21:29

1 Answer 1


Use div instread of ul and li and make its width 1/3 of the row , or use count integer variable and make logic which insert row after integer divisible by 3.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.