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

?>


<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
	
	<header class="single-entry-header">
		<?php
		if ( is_singular() ) :
			the_title( '<h1 class="entry-title">', '</h1>' );
		else :
			the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );
		endif;

		if ( 'post' === get_post_type() ) :
			?>
			<div class="entry-meta">
				<?php
				$display_category = get_theme_mod( 'vastnews_display_category', true );
				if ( $display_category === true ) {
				?>
				<div class="category">
					<?php vastnews_the_category(); ?>
				</div>
				<?php 
				} ?>

				<?php
				$display_date= get_theme_mod( 'vastnews_display_date', true );
				if ( $display_date === true ) {
				?>
				<div class="date">
					<i class="far fa-calendar-alt"></i>
					<?php vastnews_posted_on();	?>	
				</div>
				<?php 
				} ?>
				
				<?php
				$display_author = get_theme_mod( 'vastnews_display_author', true );
				if ( $display_author === true ) {
				?>
				<div class="author">	
					<i class="far fa-user"></i>
					<?php vastnews_posted_by();	?>		
				</div>
				<?php 
				} ?>
		
			</div><!-- .entry-meta -->
		<?php endif; ?>
	</header><!-- .entry-header -->

	<?php vastnews_post_thumbnail(); ?>

	<div class="entry-content">				
		<?php the_content(); ?>
	</div><!-- .entry-content -->

    <footer class="entry-footer">
	    <?php
		$display_tag = get_theme_mod( 'vastnews_display_tag', true );
		if ( $display_tag === true ) {

			vastnews_entry_footer();
		}
		?>	
    </footer><!-- .entry-footer -->	 
</article><!-- #post-<?php the_ID(); ?> -->