<?php
/* Content display template */
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    <header class="entry-header">
        <h1 class="entry-title"><?php the_title(); ?></h1>		
	<?php if (get_post_meta(get_the_ID(), "post_intro", true)) { ?>
    <div class="single2-intro"><?php echo esc_html(get_post_meta(get_the_ID(), "post_intro", true) ); ?></div>
    <?php } ?>	
        <div class="below-title-meta">
            <div class="submeta-singlepost"><a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>" rel="author"><?php printf( __( ' %s', 'efpose' ), get_the_author() ); ?></a>
                <?php if(get_the_author_meta('Position') ): ?>
                <?php esc_attr_e('/', 'efpose'); ?>
                <?php echo get_the_author_meta('Position'); ?>
                <?php else: ?>
                <?php endif; ?>
                <?php $category = get_the_category();
				if ($category) { echo '- <span><a href="' . esc_url(get_category_link($category[0]->term_id)) . '" title="' . sprintf( esc_attr__("View all posts in %s", "efpose"), $category[0]->name ) . '" ' . ">" . $category[0]->name . "</a> </span>-";}
				?>
                <?php echo get_the_date(); ?>
			</div>
            <div class="adt-comment">
                <div class="features-onsinglepost">
                    <?php if (function_exists("sharing_display")) {echo sharing_display();} ?>
                </div>
            </div>
        </div>
    </header>
    <div class="feature-postimg">
        <?php the_post_thumbnail("full"); ?>
        <?php $get_description = get_post(get_post_thumbnail_id())->post_excerpt;
		if(!empty($get_description)){
			echo '<div class="singlepost-caption">' . $get_description . '</div>';
		}?>
    </div>
    <div class="entry-content singledefault">
        <div class="singledefault-left sidebarcontent">
            <div class="author-avatar1">
			<span>
			<?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'efpose_author_bio_avatar_size', 88 ) ); ?></span>
			<span> <a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>" rel="author"><?php printf( __( ' %s', 'efpose' ), get_the_author() ); ?></a>
                <?php if(get_the_author_meta('Position') ): ?>
                <span><?php esc_attr_e('-', 'efpose'); ?><?php echo get_the_author_meta('Position'); ?></span>
                <?php else: ?>
                <?php endif; ?>
            </span>
			<span> <?php echo wp_trim_words( get_the_author_meta('description') , 11 ); ?></span>
			</div>
            <?php if(get_post_meta( get_the_ID(), 'adv_vert_id' , true )){ ?>
            <div class="tvseason-left2"><a href="<?php echo esc_html(get_post_meta(get_the_ID(), "adv_vertlink", true) ); ?>" target="_blank"><?php echo  ''.$image_two = wp_get_attachment_image( get_post_meta( get_the_ID(), 'adv_vert_id', 1 ), 'poster' ).''; ?></a></div>
            <?php }	?>
            <div class="metaview-wrapper">
                <?php if (function_exists("efpose_get_post_view")) { ?>
                <span class="metaview1"><i class="fa fa-eye" aria-hidden="true"></i><?php echo esc_html(efpose_get_post_view()); ?></span>
                <?php } else { ?>
                <?php } ?>
                <?php if (function_exists("efpose_reading_time")) { ?>
                <span class="metaview2"><i class="fa fa-hourglass-end" aria-hidden="true"></i><?php echo esc_html(efpose_reading_time(get_the_ID())); ?></span>
                <?php } ?>
                <span class="metaview3"> <a class="link-comments" href="#respond"><i class="fa fa-comment-o" aria-hidden="true"></i>
                <?php comments_number(__('0 Comments','efpose'),__('1 Comment','efpose'),__('% Comments','efpose')); ?>
                </a> </span> </div>
        </div>
        <div class="singledefault-right">
	         <?php if(get_post_meta( get_the_ID(), 'adv_top_id' , true )){ ?>
            <div class="tvseason-left2">
			<a href="<?php echo esc_html(get_post_meta(get_the_ID(), "adv_toplink", true) ); ?>" target="_blank"><?php echo  ''.$image_two = wp_get_attachment_image( get_post_meta( get_the_ID(), 'adv_top_id', 1 ), 'poster' ).''; ?></a></div>
            <?php }	?>			
			<div class="postcolumns <?php echo esc_html(get_post_meta(get_the_ID(), "efpose_post_columns", true) ); ?>">
            <?php the_content(esc_html__('Continue reading <span class="meta-nav">&rarr;</span>',"efpose")); ?>
            </div>			 
			<?php wp_link_pages( array( 'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'efpose' ), 'after' => '</div>' ) ); ?>
            <?php if(get_post_meta( get_the_ID(), 'adv_horz_id' , true )){ ?>
            <div class="tvseason-left2"><a href="<?php echo esc_html(get_post_meta(get_the_ID(), "adv_bottomlink", true) ); ?>" target="_blank"><?php echo  ''.$image_two = wp_get_attachment_image( get_post_meta( get_the_ID(), 'adv_horz_id', 1 ), 'poster' ).''; ?></a></div>
            <?php }	?>	
            <footer class="entry-meta">
                <?php esc_html_e('TAGS: ', 'efpose'); ?>
                <?php 
				$before = '#';
				$seperator = '#'; 
				$after = '';
				the_tags( $before, $seperator, $after );
				?>
            </footer>
            <nav class="nav-single">
			<span class="nav-previous">
                <?php $prevPost = get_previous_post();
					if ($prevPost) {
						$args = [
						"posts_per_page" => 1,
						"include" => $prevPost->ID,
						];
						$prevPost = get_posts($args);
						foreach ($prevPost as $post) {
							setup_postdata($post); ?>
							<div class="postprev-top">
							<?php esc_html_e("PREVIOUS", "efpose"); ?>
							</div>
							<div class="postprev-text"><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></div>
							<?php wp_reset_postdata();
						}
				}?>
            </span>
			<span class="nav-next">
                <?php $nextPost = get_next_post();
					if ($nextPost) {
						$args = [
						"posts_per_page" => 1,
						"include" => $nextPost->ID,
						];
						$nextPost = get_posts($args);
						foreach ($nextPost as $post) {
							setup_postdata($post); ?>
							<div class="postnext-top"><?php esc_html_e("NEXT", "efpose"); ?></div>
							<div class="postnext-text"><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></div>
							<?php wp_reset_postdata();
						}
					}
				?>
             </span>
			 </nav>
        </div>
    </div>
</article>