1

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>
                </a>
                <div class="inner notop nobottom">
                    <h4 class="title"><?php the_field( 'title' )?></h4>
                    <p class="description"><?php the_field( 'content' ) ?></p>
                </div>
            </div>
            <div class="inner darken notop">
                <a href="#" class="btn btn-add-to-cart">Add<i class="icon-shopping-cart"></i></a>
            </div>
        </li>
    <?php endwhile; ?>
    </ul>
</div>
  • what is the result if you have more than three posts? what is the CSS? – Michael Dec 24 '15 at 21:29
0

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, privacy policy and cookie policy

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