<?php
	global $rst_blog;
	
	$size = array('width' => 800,'height'=>450);
	if( $rst_blog['layout'] == 1 ) $size = array('width' => 1200,'height'=> 650,'quality'=>100);
	if( $rst_blog['template'] == 'grid' ) $size = array('width' => 600,'height'=> 400,'quality'=>100);
	if( is_single() || is_page() ) $size = array('width' => 1200,'quality'=>100);
?>

<?php 
if(!is_single()){	
if( get_post_thumbnail_id(get_the_ID()) ) { ?>
	<div class="img-wrap"> <!-- Image Wrap -->
		<a href="<?php the_permalink(); ?>">
		<img  class="img-responsive" src="<?php echo bfi_thumb(wp_get_attachment_url(get_post_thumbnail_id($post->ID)),$size) ?>" alt="" /></a>
	</div>
<?php } 
}else{
	if( get_post_thumbnail_id(get_the_ID()) ) { ?>
		<div class="img-wrap">
			<img  class="img-responsive" src="<?php echo bfi_thumb(wp_get_attachment_url(get_post_thumbnail_id($post->ID)),$size) ?>" alt="" />
		</div>
	<?php }	
}
?>