Hi there,
I am making a layout that lists posts in horizontal rows of three. I have padding on my main container div and padding-left on each post to make it sit 15px away from the previous one. The problem is on the left side the padding adds to the container div's padding and throws it all off.
What I would like to do is add a class of 'first' to each post that comes into contact with the left side (1st, 4th, 7th, 10th, 13th etc.), so that I can remove the padding-left on it and make it sit flush.
I know I need to make a count, but I am not the cleverest, mathematically and I am confused about how to use operators to end up with the post numbers I want.
So far, through copying and pasting and general butchery I have this code, which is kind of doing something, but not to the right posts:
<?php
// create the navigation above the content
thematic_navigation_above();
// Custom loop for displaying all posts from the project custom post type.
$loop = new WP_Query( array( 'post_type' => 'project', 'posts_per_page' => 9 ) ); ?>
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
<?php the_title( '<h2 class="entry-title"><a href="' . get_permalink() . '" title="' . the_title_attribute( 'echo=0' ) . '" rel="bookmark">', '</a></h2>' ); ?>
<div class="entry-content">
<?php the_post_thumbnail(); ?>
<?php the_excerpt(); ?>
</div>
<?php endwhile; ?>
Would really appreciate any input.
Cheers
- Roo