<?php
/**
 * Template part for displaying posts
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
 *
 * @package edify
 */

$edify_tags_list = get_the_tag_list( '', esc_html_x( ' ', '', 'edify' ) );


$show_blog_title = get_theme_mod('show_post_title',true); 
$show_blog_author = get_theme_mod('show_post_author',true); 
$show_blog_date = get_theme_mod('show_post_date', true); 
$show_blog_comment = get_theme_mod('show_post_comment',true);  

?>
<div <?php post_class( 'post-single single-post-content-wrap' ); ?>>
	<?php if(has_post_thumbnail()): ?>
		<div class="post-thumb">
			<?php the_post_thumbnail('edify_single_blog');?>
		</div>
	<?php endif; ?>


	<div class="single-post-content">
		<div class="entry-header">
			<div class="post-meta">
				<?php if($show_blog_author) : ?>
					<span class="post-author"><?php edify_posted_by();?></span>
				<?php endif; ?>

				<?php if($show_blog_date) : ?>
				<span class="post-date"><i class="fa fa-calendar-alt mr-2"></i><?php echo get_the_time('M d, Y');?></span>
				<?php endif; ?>
				
				<?php if($show_blog_comment) : ?>
				<span class="post-comments"><i class="far fa-comments"></i><?php comments_popup_link( esc_html__( '0 comment', 'edify' ), esc_html__( '1 Comment', 'edify' ), esc_html__( '% Comments', 'edify' ) ); ?></span>
				<?php endif; ?>
			</div>

			<?php if($show_blog_title) : ?>
				<h1 class="post-title"><?php the_title();?></h1>
			<?php endif; ?>
		</div>
		
		<div class="entry-content">
			<?php the_content();?>
		</div>
	</div>

	<!--  tag Lists -->
	<div class="blog-footer-meta d-md-flex justify-content-between align-items-center">
		<div class="post-tags mb-4 mb-md-0">
			<?php echo edify_wp_kses($edify_tags_list);?>
		</div>
	</div>

</div>