<?php 
/**
 * The template for displaying a full width thumbnail
 *
 * @package WordPress
 * @subpackage Edition
 * @since Edition 1.0
 */
global 
$tw_entry,
$fields_installed; // Get post options 

if ( ($tw_entry->thumbnail_class == 'has-thumbnail' && $tw_entry->featured_image == 1) && !$tw_entry->has_media ) :
	$imgid = get_post_meta($post->ID,'_thumbnail_id',false); // Get Image ID

	if($imgid) {
		$alt   = get_post_meta($imgid[0], '_wp_attachment_image_alt', true); // Alt text of image
		$full  = wp_get_attachment_image_src($imgid[0], 'fullslideshownc', false);  // URL of Featured Full Image
	} ?>

 	<!-- Post Title -->
    <div class="pagetitleloading background-imaged loading-dark">
    	<div class="pagetitle item imagewrapper full-image">

		<!-- Featured Post Image -->
		<div class="imagecover">
			<img src="<?php echo esc_url( $full[0] ); ?>" alt="<?php echo esc_attr( $alt ); ?>" class="top-bg-image"/>
		</div>
        
		<!-- Post Image Overlay -->
		<div class="overlay"></div>

        <?php
			/**
			 * Get Thumbnail Credits
			 */
			$thumbnail_image = get_posts(array('p' => $imgid[0], 'post_type' => 'attachment'));
			if ($thumbnail_image[0]->post_excerpt && isset($thumbnail_image[0])) {
				echo '<span class="credits">'.$thumbnail_image[0]->post_excerpt.'</span>';
			} 
        ?>

        <!-- Post Title -->
        <div class="posttitle slidecaptionwrap">
			<div class="slidecaptioncenter container">
				<div class="slidecaption">
					<div class="col-md-8">

						<!-- Categories -->
						<div class="badge"><?php echo ag_get_cats(3); ?></div>

						<!-- Post Title -->
						<h1 class="title entry-title" <?php if ( tw_issetor($tw_entry->review_post) == 'yes' ) { echo 'itemprop="itemreviewed"'; } ?>>
							<?php the_title(); ?>
						</h1>

						<!-- Author Section -->
						<div class="byline">
							<!-- Author Image -->
							<?php echo get_avatar( get_the_author_meta( 'ID' ), 38 ); ?> 

							<!-- Author Link -->  
							<span class="author vcard tiny-details">
								<?php _e('By','themewich');?> 
								<span class="fn" <?php if ( tw_issetor($tw_entry->review_post) == 'yes' ) { echo 'itemprop="reviewer"'; } ?>>
									<?php tw_author_link('posts'); ?>
								</span>
								<span class="mobiledate">
									<span class="tw-bullet">&nbsp;&bull;&nbsp;</span>
									<?php themewich_date('human'); ?>
								</span>
							</span>
						</div>
					</div>
           		</div>
        	</div>              
		</div>
        <!-- End Title --> 
        
		<!-- Date -->
		<span <?php if ( tw_issetor($tw_entry->review_post) == 'yes' ) { echo 'itemprop="dtreviewed" datetime="' . get_the_time('c') . '"'; } ?>></span>
		<div class="date updated">
			<span class="day">
				<?php the_time('d'); ?>
			</span>
			<p>
				<span class="month">
					<?php the_time('M'); ?>
				</span>
				<br />
				<span class="year">
					<?php the_time('Y'); ?>
				</span>
			</p>
		</div>

	</div>
</div>
<!-- End Post Title -->

<?php endif;