I want blog posts to populate the homepage in rows of three. The first three blost posts show up fine, but afterwards the blog posts are off. I would like for each post to line up vertically as well as horizontally. You can see an example here.
Do I need to add a row for every three posts? I'm not sure how I could code that in?
<div class="row-fluid">
<?php $cat_id = 10; //the certain category ID
$latest_cat_post = new WP_Query( array('posts_per_page' => -1, 'orderby' => rand, 'category__in' => array($cat_id)));
if( $latest_cat_post->have_posts() ) : while( $latest_cat_post->have_posts() ) : $latest_cat_post->the_post(); ?>
<div class="span4" style="text-align:center;background-color:#999999;margin-bottom:20px;">
<a class="" href="<?php the_permalink() ?>"><?php echo get_the_post_thumbnail( $post_id, $size=0, $attr ); ?></a>
<span><a style="color:#5a5a5a;" class="" href="<?php the_permalink() ?>"><h5 class="lead"><?php the_title(); ?></h5></a>
</span>
</div>
<?php endwhile; endif; ?>
</div><!--row-fluid-->