<!--BEGIN .hentry -->
<div <?php post_class(); ?> id="post-<?php the_ID(); ?>">
	
	<?php 
	
		$count = 1;
		if(is_singular()) { $count = -1; }
		
        $args = array(
            'orderby'		 => 'menu_order',
            'post_type'      => 'attachment',
            'post_parent'    => get_the_ID(),
            'post_mime_type' => 'image',
            'post_status'    => null,
            'posts_per_page' => $count
        );
        $attachments = get_posts($args);
        
    ?>

	
	<?php if ($attachments) : ?>
	
	<div class="post-thumb clearfix">
		
        <?php if(!is_singular()) : ?>
        <a title="<?php the_title(); ?>" href="<?php the_permalink(); ?>">
        <?php endif; ?>
        
             <?php foreach ($attachments as $attachment) : ?>
                    
                <?php $src = wp_get_attachment_image_src( $attachment->ID, 'thumbnail-blog'); ?>
                
                <div>
                <img 
                height="<?php echo $src[2]; ?>"
                width="<?php echo $src[1]; ?>"
                alt="<?php echo apply_filters('the_title', $attachment->post_title); ?>" 
                src="<?php echo $src[0]; ?>" 
                />
                </div>
                
            <?php endforeach; ?>

        <?php if(!is_singular()) : ?>
        </a>
        <?php endif; ?>

	</div>
    
    <?php endif; ?>
    
    <?php if(!is_singular()) : ?>
    
    <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php _e('Permalink to:', 'framework');?> <?php the_title(); ?>"><?php the_title(); ?></a></h2>
    
    <?php endif; ?>
    
    <?php if(!is_single()) get_template_part('includes/post-meta'); ?>

    <!--BEGIN .entry-content -->
    <div class="entry-content clearfix">
        <?php the_content(''); ?>
    <!--END .entry-content -->
    </div>

<!--END .hentry-->  
</div>