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

$showcategory = get_theme_mod('category_display',true);
$showdate = get_theme_mod('date_display',true);
$showauthor = get_theme_mod('author_display',true);

?>

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
	<div class="post-item">
		<div class="post-img">
			<?php vastnews_post_thumbnail(); ?>
		</div>

		<div class="post-text">
			<?php if ( $showcategory === true ) : ?>
			   <div class="cat">
				   <?php vastnews_the_category(); ?>
			   </div>
		    <?php endif; ?>
			<header class="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 if ( $showdate === true ) : ?>
					 <div class="date">
						 <?php vastnews_posted_on();	?>	
					 </div>
					 <?php endif; ?>
					 <?php if ( $showauthor === true ) : ?>
					 <div class="author">	
						 <?php vastnews_posted_by();	?>		
					 </div>
					 <?php endif; ?>
				</div><!-- .entry-meta -->
				<?php endif; ?>
		    </header><!-- .entry-header -->
			<div class="entry-summary">
				<?php the_excerpt(); ?>
			</div><!-- .entry-summary -->
		</div>
    </div>
</article><!-- #post-<?php the_ID(); ?> -->

