WordPress.org

Ready to get started?Download WordPress

Forums

Grid layout (side by side) with different post classes? (1 post)

  1. adu co
    Member
    Posted 11 months ago #

    Hi! I'm working on a theme where i'm using the code below to grid posts side by side, the problem is that i'm working with Twitter bootstrap and i'd like to give the first and last post on each row a "pull-left" or "pull-right" class.

    Any ideas?

    <?php query_posts('category_name=Menucard'); ?>
    	<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    
    	<div class="span4 post move pull-left">
    		<?php
    		    //echo post here
    		    the_content();
    		?>
    
    	</div> <!-- close .post div -->
    
    	<?php
    	    $counter++;
    	    if ($counter % 3 == 0) {
    	    echo '<div style="clear:both;"></div>';
    	    }
    	?>

Reply

You must log in to post.

About this Topic