this is a little over my head but i'm trying to work through it. if you look at http://shirtsaboutnothing.com/wordpress/categories-page/">this page you'll see that's its pulling in the pictures and titles from the different posts. i'm using the code here to make it happen: http://pastebin.com/zJmiieDv along with this css: .project-box-1 {float:left; padding-left:0; width:300px;} .project-box {float:left; padding-left:29px; width:300px;} Code (markup): the problem i have is when there's more than 3 posts, the first one that appears in the second row has the attributes of project box, but i want it to have the attributes of .project-box-1. how do i alter my code so that the first item and every 3 after that have .project-box-1 assigned to them??? please advise. thanks!
<div id="recent-projects"> <?php $count = 1; $recentblog = new WP_Query(); $recentblog->query("category_name=parent-category"); ?> <?php if ($recentblog->have_posts()) : while ($recentblog->have_posts()) : $recentblog->the_post(); ?> <?php if ($count == 1) : ?> <div class="project-box-1"> <?php else : ?> <div class="project-box"> <?php endif; ?> <a href="<?php the_permalink(); ?>"><img src="<?php $thumb = get_post_custom_values('portfolio-image'); echo $thumb[0]; ?>" alt="<?php the_title(); ?>" /> <h4><?php the_title(); ?></h4></a> </div> <?php $count++; if ($count > 3) count = 1; ?> <?php endwhile; endif; ?> <!--end recent-projects--></div> Code (markup): Hope that works, I have not tested it yet
thanks cash. what i have in the pastebin file above seems to work so i'm gonna go with that. appreciate the effort.
actually, now i'm having trouble with the code thats in place: http://pastebin.com/Lj8hPnGy if you look on the page you'll notice that it only shows 10 images. No matter how many more i add, it wont show more than 10. please advise how i get it to display all of them. thanks in advance.