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

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
	<div class="blog-post-container ">
		<div class="blog-post-inner">
			<div class="blog-post-image">
				<?php fuzion_blog_post_thumbnail(); ?>
				<div class="post-meta-comment">
					<span class="post-comments">
						<a href="<?php the_permalink(); ?>"><i class="fa fa-comment" aria-hidden="true"></i><?php echo absint( get_comments_number( get_the_ID() ) ); ?></a>
					</span>
				</div>
			</div>
			<div class="blog-post-detail">
				<?php if ( 'post' === get_post_type() ) : ?>
					<div class="post-category">
						<?php fuzion_blog_categories_list(); ?>
					</div>
				<?php endif; ?>
				<?php
				if ( is_singular() ) :
					the_title( '<h1 class="post-main-title">', '</h1>' );
				else :
					the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );
				endif;
				?>
				<div class="post-excerpt">
					<?php the_excerpt(); ?>
				</div>
				<?php
				$posted_by = get_theme_mod( 'fuzion_blog_post_hide_author', false );
				$posted_on = get_theme_mod( 'fuzion_blog_post_hide_date', false );
				if ( $posted_by === false || $posted_on === false ) {
					?>
					<div class="post-meta">
						<?php
						fuzion_blog_posted_by();
						fuzion_blog_posted_on();
						?>
					</div>
				<?php } ?>
			</div>
		</div>
	</div>	
</article><!-- #post-<?php the_ID(); ?> -->
