My themes code outputs different boxes so it might look a little complex. If you take away the various types of box content it gets simple...
!-- scrollable -->
<div class="scrollable">
<div class="items">
<div class="featured">
<?php while (have_posts()) : the_post();?>
<?php if( $postnum % 9 == 0 && $postnum !=0) : $postnum +9; ?>
<div class="clear"> </div>
</div>
<div class="featured">
<?php endif; ?>
<?php $postnum = $postnum + 1;?>
<!-- if movie values -->
<?php
$movie = get_post_custom_values("movie");
if (isset($movie[0])) {?>
<div title="Click to flip" class="flip">
<div class="flipWrap"> <img src="<?php $thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id(), 'portfolio');echo $thumbnail[0]; ?>" /> </div>
<div class="flipData">
<p class="flipContent"><a href="<?php the_permalink() ?>"><strong>
<?php the_title(); ?>
</strong></a><br />
<?php excerpt('30'); ?>
<br />
<a href="<?php the_permalink() ?>">more details</a></span></p>
</div>
<a class="zoom-mov" title="<?php the_title(); ?>" href="<?php echo get_post_meta($post->ID, "movie", $single = true); ?>" rel="prettyPhoto[gallery]"> </a> </div>
<!--else image values -->
<?php }else {?>
<?php
$key = 'alt-thumb';
$themeta = get_post_meta($post->ID, $key, TRUE);
// decide style
if( get_post_meta($post->ID, 'wtgservice', TRUE) )
{
$thestyle = 'wtgservice';// currently has no css setup, simple causes no icon to be displayed
}
else
{
$thestyle = 'zoom';
}
if($themeta != '') {?>
<!-- if alt thumb do this -->
<div title="Click to flip" class="flip">
<div class="flipWrap"> <img src="<?php echo get_post_meta($post->ID, "alt-thumb", true);?>" /> </div>
<div class="flipData">
<p class="flipContent"><a href="<?php the_permalink() ?>"><strong>
<?php the_title(); ?>
</strong></a><br />
test1<?php excerpt('30'); ?>
<br />
<a class="readmore" href="<?php the_permalink() ?>">more details</a></span></p>
</div>
<a class="<?php echo $thestyle; ?>" title="<?php the_title(); ?>" href="<?php $thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full');echo $thumbnail[0]; ?>"rel="prettyPhoto[gallery]"> </a> </div>
<!-- else get the image values -->
<?php } else { ?>
<div title="Click to flip" class="flip">
<div class="flipWrap"> <img src="<?php $thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id(), 'portfolio');echo $thumbnail[0]; ?>" /> </div>
<div class="flipData">
<p class="flipContent"><a href="<?php the_permalink() ?>"><strong>
<?php the_title(); ?>
</strong></a><br />
test2<?php excerpt('30'); ?>
<br />
<a class="readmore" href="<?php the_permalink() ?>">more details</a></span></p>
</div>
<a class="<?php echo $thestyle; ?>" title="<?php the_title(); ?>" href="<?php $thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full');echo $thumbnail[0]; ?>"rel="prettyPhoto[gallery]"> </a> </div>
<?php } ?>
<?php }?>
<?php endwhile;?>
</div>
</div>
<!-- end items -->
<div class="clear"> </div>
</div>
<!-- end scrollable -->