<?php
/**
 * The Template for displaying all single posts.
 *
 * @package vw-book-store-pro
 */
	get_header();
	get_template_part( 'template-parts/banner' );
	$postcol1 = ''; $postcol2= '';
	if(get_theme_mod('vw_book_store_pro_post_general_settings_post_sidebar',true)=='1')
	{
		$postcol1 = "col-lg-8 col-md-7";
		$postcol2 = "col-lg-4 col-md-5";
	}else{
		$postcol1 = "col-lg-12 col-md-12";
		$postcol2 = "";
	}
?>
<div class="container">
	<div class="row">
		<div class="content_page <?php echo esc_html($postcol1); ?>">
			<?php while ( have_posts() ) : the_post(); ?>
			<div class="content_boxes">
				 <?php if ( get_theme_mod('vw_book_store_pro_blog_featured_image_enable',true) == "1" ) { ?>
				<?php if ( has_post_thumbnail() ) { ?>
					<div class="feature-box">
						<img src="<?php the_post_thumbnail_url( 'full' ); ?>">
					</div>
				<?php } }?>
				<div class="metabox">
					<?php if ( get_theme_mod('vw_book_store_pro_post_general_settings_post_date',true) == "1" ) { ?>
					<span class="entry-date"><?php echo esc_html( get_the_date() ); ?></span>
					<?php } ?>
					
					<?php if ( get_theme_mod('vw_book_store_pro_post_general_settings_post_author',true) == "1" ) { ?>
					<span class="entry-author"><a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>"><?php the_author(); ?></a></span>
					<?php } ?>
					<?php if ( get_theme_mod('vw_book_store_pro_post_general_settings_post_comments',true) == "1" ) { ?>
          <a href="#comments"><span class="entry-comments"><?php comments_number( __( '0 Comments','vw-book-store-pro' ), __( '0 Comments','vw-book-store-pro' ), __( '0 % Comments','vw-book-store-pro' ) ); ?></span></a>
          <?php } ?>
					
				</div>
				<div class="single-post-content">
					<?php the_content();?>
				</div>

				<?php if ( get_theme_mod('vw_book_store_pro_post_general_settings_post_share',true) ) {
						if ( function_exists('vw_book_store_pro_social_share') ) {
							vw_book_store_pro_social_share();
						}
	                } 

	                if(get_theme_mod('vw_book_store_pro_tags', true)){ ?>
		                <p class="col-md-6 post_tag">
	                    	<?php
	                        if( $tags = get_the_tags() ) {
	                            echo '<span class="meta-sep"></span>';
	                            foreach( $tags as $vw_tag ) {
	                              $sep = ( $vw_tag === end( $tags ) ) ? '' : ' ';
	                              echo '<a href="' . esc_url(get_term_link( $vw_tag, $vw_tag->taxonomy )) . '">#' . esc_html($vw_tag->name) . '</a>' . esc_html($sep);
	                            }
		                    } ?>
		                </p>
		            <?php }    

	                 if(get_theme_mod('vw_book_store_pro_post_general_settings_post_category',true)=="1"){ ?>
		                <div class="post_ctg font-weight-bold"><span><?php echo esc_html('Categories: ','vw-book-store-pro'); ?></span><?php the_category();?></div>
			
						<?php } 

					if(get_theme_mod('vw_book_store_pro_autherdetails', true)){
						if ( function_exists('vw_book_store_pro_post_auther_bio') ) {
							vw_book_store_pro_post_auther_bio();
						}
					}
                 // If comments are open or we have at least one comment, load up the comment template
				if ( comments_open() || '0' != get_comments_number() ) {
					comments_template();
				}

					if(get_theme_mod('vw_book_store_pro_related_posts',true)){
						if ( function_exists('vw_book_store_pro_related_posts') ) {
							vw_book_store_pro_related_posts();
						}
					}
			
					if(get_theme_mod('vw_book_store_pro_pagination',true)){
						if ( function_exists('vw_book_store_pro_single_navigation') ) {
							vw_book_store_pro_single_navigation();
						}
					}
				endwhile; // end of the loop. ?>
			</div>
		</div>
        <?php if(get_theme_mod('vw_book_store_pro_post_general_settings_post_sidebar',true)=='1'){ ?>
			<div class="<?php echo esc_html($postcol2); ?>" id="sidebar">
	          <?php dynamic_sidebar('sidebar-1'); ?>
	        </div>
	    <?php } ?>
		<div class="clearfix"></div>
	</div>
</div>
<?php get_footer();