<?php
/*
 * Content display template.
 */
?>
<div class="single-wrapper">
    <div class="single4-topwrapper">
        <?php efpose_breadcrumb(); ?>
    </div>
    <div class="singletitle-wrapper">
        <div class="singletitle-prev">
            <div class="singletitle-time">
                <div class="singletitle-date">
                    <h1>
                        <?php the_time( 'jS' ); ?>
                    </h1>
                </div>
                <div class="singletitle-year">
                    <?php the_time( 'F' ); ?>
                </div>
            </div>
        </div>
        <div class="singletitle-title">
            <header class="entry-headerdefault">
                <div class="singletitle-cat">
                    <?php the_category(', '); ?>
                </div>
                <h1 class="entry-title">
                    <?php the_title(); ?>
                </h1>
            </header>
        </div>
    </div>
    <div class="singletitle-wrapperimage">
        <div class="singletitle-meta">
            <div class="singlepost-share features-onsinglepost">
                <?php if ( function_exists( 'sharing_display' ) ) { echo sharing_display(); } ?>
            </div>
            <div class="singlepost-totalmeta"> <a class="link-comments" href="<?php comments_link(); ?>">
                <?php comments_number(__('0 Comments','efpose'),__('1 Comment','efpose'),__('% Comments','efpose')); ?>
                </a> </div>
            <div class="singlepost-totalview">
                <?php if (function_exists("efpose_get_post_view")) { ?>
                <?php echo esc_html (efpose_get_post_view()); ?>
                <?php } else { ?>
                <?php } ?>
            </div>
            <div class="singlepost-totalread">
                <?php if (function_exists("efpose_reading_time")) { ?>
                <?php echo esc_html (efpose_reading_time(get_the_ID())); ?>
                <?php } else { ?>
                <?php } ?>
            </div>
        </div>
        <div class="singletitle-image">
            <?php $url = esc_url( get_post_meta( get_the_ID(), 'efpose_audio', 1 ) ); echo wp_oembed_get( $url );?>
        </div>
    </div>
    <div class="singlemidle-wrapper <?php echo esc_html(get_post_meta(get_the_ID(), "efpose_sidebar", true) ); ?>">
        <?php while ( have_posts() ) : the_post(); ?>
        <div id="primary" <?php body_class('site-content'); ?>>
            <div id="content"  class="single4content"role="main">
                <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
                    <div class="entry-content contentinwrapper">
                        <div class="entry-contentinside">
                            <?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 }	?>
                        </div>
                        <?php if(get_post_meta( get_the_ID(), 'adv_vert_id' , true )){ ?>
                        <div class="entry-contentadv"><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>
                </article>
                <footer class="entry-meta">
                    <?php esc_html_e('TAGS: ', 'efpose'); ?>
                    <?php $before = '#';
					$seperator = '#'; 
					$after = '';
					the_tags( $before, $seperator, $after );
					?>
                </footer>
                <!-- .nav-single -->
                <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>
                <!-- author-info -->
                <div class="author-single">
                    <?php get_template_part("inc/author-singlepost"); ?>
                </div>
                <div class="singledefault relatedpost"> 
                    <!-- related post -->
                    <?php  get_template_part( 'inc/related-post' ); ?>
                </div>
                <div class="singledefault commentblock"> 
                    <!-- related post -->
                    <?php comments_template( '', true ); ?>
                </div>
                <?php endwhile; // end of the loop. ?>
            </div>
            <!-- #content --> 
        </div>
        <div class="sidebar">
            <div class="single2-widget">
                <?php get_sidebar(); ?>
            </div>
        </div>
    </div>
</div>