<?php

global $post;

$restorator_width = 1170;
$restorator_height = 650;
if( isset($style) && ( $style == 'grid_top_img' || $style == 'masonry_top_img' ) ) {
	if( $columns != 'col1' ) {
		$restorator_width = 550;
		$restorator_height = 400;
	} else {
		$restorator_width = 1170;
		$restorator_height = 700;
	}
}
if( isset($style) && ( $style == 'grid_card' || $style == 'masonry_card' ) ) {
	if( $columns != 'col1' ) {
		$restorator_width = 670;
		$restorator_height = 450;
	} else {
		$restorator_width = 1170;
		$restorator_height = 610;
	}
}
if( isset($style) && ( $style == 'masonry_top_img' || $style == 'masonry_card' ) ) {
	$restorator_height = '';
}

$featured_image_url = wp_get_attachment_url(get_post_thumbnail_id());
$attachment_title = get_the_title();
?>

	<?php if (!empty( $featured_image_url )) { ?>
		<?php if ( !is_single() ) { ?>
			<div class="post-image">
				<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__('Permalink to %s', 'restorator'), the_title_attribute('echo=0') ); ?>" rel="bookmark">
					<img src="<?php restorator_aq_resize( $featured_image_url, $restorator_width, $restorator_height, true, true, true ); ?>" alt="<?php echo esc_attr( $attachment_title ); ?>" />
					<div class="play_btn"><span></span><i class="fa fa-music"></i></div>
				</a>
			</div>
		<?php } else { ?>
			<div class="post-audio">
				<?php echo do_shortcode( get_post_meta( $post->ID, 'restorator_post_audio_embed', true ) ); ?>
			</div>
		<?php } ?>
	<?php } ?>