1 reply [Last post]
endortrails
endortrails's picture
Offline
Regular
Kansas
Last seen: 12 years 9 weeks ago
Kansas
Joined: 2008-02-18
Posts: 11
Points: 0

Howdy folks....I'm having a bit of brain freeze right now. I'm building a three column archive page (not using unordered list, but rather, using the Blueprint CSS framework). I'm dynamically generating a "last" class on every third post, which Blueprint needs to make the last column not contain right padding (throws off layout). The problem is, I need to clear the float at the end of every third entry, because as it stands, the columns are all float left, so they ride up, throwing off the grid layout. Here is the testing site:

http://themes.thadallender.com/?cat=3

Here is the code I'm working with:

<?php $i = 0; ?> <?php while (have_posts()) : the_post(); $i++; ?>

last<?php $i = 0; } ?>">
"> " rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title() ?> <?php $values = get_post_custom_values("thumbnail"); if (isset($values[0])) { ?> " rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">" alt="<?php the_title(); ?>" title="<?php the_title(); ?>" class="thumbnail" /> <?php } ?> <?php $values = get_post_custom_values("thumbnail-news"); if (isset($values[0])) { ?> " rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">" alt="<?php the_title(); ?>" title="<?php the_title(); ?>" class="thumbnail" /> <?php } ?> <?php the_excerpt(); ?>
<?php endwhile; ?>

Any CSS gods want to take a stab at this?

endortrails
endortrails's picture
Offline
Regular
Kansas
Last seen: 12 years 9 weeks ago
Kansas
Joined: 2008-02-18
Posts: 11
Points: 0

PHP count to add <div class="clear"></div>

The brain freeze thawed. Here is the solution:

<?php $i = 0; ?>
<?php while (have_posts()) : the_post(); $i++; ?>

last<?php } ?>">
">
" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title() ?>
<?php
$values = get_post_custom_values("thumbnail");
if (isset($values[0])) {
?>
" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">" alt="<?php the_title(); ?>" title="<?php the_title(); ?>" class="thumbnail" />
<?php } ?>
<?php
$values = get_post_custom_values("thumbnail-news");
if (isset($values[0])) {
?>
" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">" alt="<?php the_title(); ?>" title="<?php the_title(); ?>" class="thumbnail" />
<?php } ?>
<?php the_excerpt(); ?>



<?php if ($i == 3) { ?>
<?php $i = 0; } ?>
<?php endwhile; ?>