<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
	<div class="share-post">
		<?php if ( get_post_type() == 'post' ): ?>
			<div class="date-meta"><?php echo get_the_date( "d\<\i\>\ M\<\/\i\>\ " ) ?></div>
			<?php do_action( 'thim_social_share' ); ?>
		<?php endif ?>
	</div>
	<div class="content-inner">
		<?php if ( get_post_type() == 'recipe' ) {

			$image   = wp_get_attachment_image( get_post_thumbnail_id( get_the_ID() ), 'full' );
			$name    = esc_attr( get_the_title() );
			$details = thim_get_recipe_details( $id );
			?>
			<div class="recipe-image">
				<?php
				if ( function_exists( 'thim_get_recipe_details' ) ) {
					$details   = thim_get_recipe_details();
					$video_url = $details['video_url'];
					if ( $video_url ) {
						// Get the video URL from custom field
						$videoID = substr( $details['video_url'], 32 );
						// Echo out the thumbnail, give it height and weight and set the alternate description to post title
						echo '<img class="video-img" src="http://i1.ytimg.com/vi/' . $videoID . '/maxresdefault.jpg" alt="' . get_the_title() . '">';
						echo '<div class="wrap-play"><div class="play-button"><a  href="' . esc_url( get_the_permalink() ) . '"><i class="fa fa-play"></i></a></div></div>';

					} else { // else use the standard featured image
						echo wp_get_attachment_image( get_post_thumbnail_id( get_the_ID() ), 'full' );
					}
				}
				?>
				<a class="link" href="<?php echo esc_url( get_the_permalink() ); ?>"></a>
				<?php if ( is_plugin_active( 'comment-rating-stars/comment-star-reviews.php' ) ) : ?>
					<div class="rating-star">
						<div class="rating-star-wrap">
							<?php echo csr_get_overall_rating_stars( get_the_ID() ); ?>
						</div>
					</div>
				<?php endif; ?>
			</div>
		<?php
		} else {
			do_action( 'thim_entry_top', 'full' );
		}?>

		<?php

		$theme_options_data = theme_options_data();
		if ( !isset( $theme_options_data['thim_show_excerpt_post'] ) ) {
			$theme_options_data['thim_show_excerpt_post'] = 1;
		}

		?>
		<div class="entry-content">
			<?php
			if ( has_post_format( 'link' ) && thim_meta( 'thim_url' ) && thim_meta( 'thim_text' ) ) {
				$url  = thim_meta( 'thim_url' );
				$text = thim_meta( 'thim_text' );
				if ( $url && $text ) {
					?>
					<header class="entry-header">
						<h3 class="blog-title">
							<a class="link" href="<?php echo esc_url( $url ); ?>"><?php echo esc_html( $text ); ?></a>
						</h3>
					</header>

				<?php
				}
				?>
				<div class="entry-summary">
					<?php
					if ( $theme_options_data['thim_show_excerpt_post'] ) {
						the_excerpt();
					}
					?>
				</div><!-- .entry-summary -->
			<?php
			} elseif ( has_post_format( 'quote' ) && thim_meta( 'thim_quote' ) && thim_meta( 'thim_author_url' ) ) {
				$quote      = thim_meta( 'thim_quote' );
				$author     = thim_meta( 'thim_author' );
				$author_url = thim_meta( 'thim_author_url' );
				if ( $author_url ) {
					$author = ' <a href=' . esc_url( $author_url ) . '>' . $author . '</a>';
				}
				if ( $quote && $author ) {
					?>
					<header class="entry-header">
						<div class="box-header box-quote">
							<blockquote><?php echo esc_html( $quote ); ?><cite><?php echo esc_html( $author ); ?></cite>
							</blockquote>
						</div>
					</header>
				<?php
				}
			} elseif ( has_post_format( 'audio' ) ) {
				?>

				<?php the_title( sprintf( '<header class="entry-header"><h2 class="blog-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2></header>' ); ?>
				<div class="entry-summary">
					<?php
					if ( $theme_options_data['thim_show_excerpt_post'] ) {
						the_excerpt();
					}
					?>
				</div><!-- .entry-summary -->
			<?php
			} else {
				?>
				<header class="entry-header">
					<?php the_title( sprintf( '<h2 class="blog-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' ); ?>
					<?php thim_entry_meta(); ?>
				</header>
				<!-- .entry-header -->
				<div class="entry-summary ">
					<?php
					if ( $theme_options_data['thim_show_excerpt_post'] ) {
						the_excerpt();
					}
					?>
				</div><!-- .entry-summary -->
			<?php }; ?>
		</div>
	</div>
</article><!-- #post-## -->