<?php
/**
 * Search results partial template
 *
 * @package Poster
 */

// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
?>

<article <?php post_class(); ?> id="post-<?php the_ID(); ?>">
	<div class="row g-0 border rounded overflow-hidden flex-md-row mb-4 shadow-sm position-relative">
	<?php if (get_theme_mod('poster_enable_featured') !== 'disable') { ?>
		<div class="col-auto d-lg-block">
			<?php echo get_the_post_thumbnail( $post->ID, 'medium' ); ?>			
		</div>
	<?php } ?>
		<div class="col d-flex flex-column position-static">
			<header class="entry-header">
				<?php
				the_title(
					sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ),
					'</a></h2>'
				);
				?>
			
			</header><!-- .entry-header -->
			<?php if (get_theme_mod('poster_enable_excerpt') == 'enable') { ?>
				<div class="entry-content card-text mb-auto">
					<?php
						the_excerpt();
						poster_link_pages();
					?>
				</div><!-- .entry-content -->
			<?php } ?>
		</div>
		<?php 
		if (get_theme_mod('poster_blog_postmeta') !== 'disable') { ?>
		<div class="row post-footer">  
				<?php poster_entry_footer(); 
				if (get_theme_mod('poster_blogmeta_comments') !== 'disable') {
			poster_comments_popup_link();
		} ?>
		 <?php if ( 'post' === get_post_type() ) : ?>
						<?php poster_posted_on(); ?>
						
				<?php endif; ?>
			   <?php 
			   if (get_theme_mod('poster_blog_viewcount') !== 'disable') {
			   display_post_view_count(); }
			   ?>
				<?php if (get_theme_mod('poster_enable_readmore') !== 'disable') { ?>
				<a class="read-more-link" href="<?php echo esc_url( get_permalink( get_the_ID() ) ); ?>"><?php echo	esc_attr(get_theme_mod('poster_readmore_text', 'Read More')); ?><span class="screen-reader-text"><?php echo get_the_title( get_the_ID() ); ?></span></a>
				<?php } ?>
				
				</div>				
		<?php } ?>
</div>
</article><!-- #post-<?php the_ID(); ?> -->
