<?php
/**
 * Post rendering content according to caller of get_template_part
 *
 * @package Digital
 */

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

<article <?php post_class(); ?> id="post-<?php the_ID(); ?>">
<?php if (get_theme_mod('digital_blogmeta_comments') !== 'disable') { ?>
<div class="comment block"><p><?php printf( _nx( '1', '%1$s', get_comments_number(), 'comments title', 'digital' ), number_format_i18n( get_comments_number() ) ); ?><p></div><?php } ?>
	<div class="row g-0 border rounded overflow-hidden flex-md-row mb-4 shadow-sm position-relative">
	<?php if (get_theme_mod('digital_enable_featured') !== 'disable') { ?>
		<div class="col-auto d-lg-block">			
			<a href="<?php echo esc_url( get_permalink() ); ?>" rel="bookmark">
			<?php echo get_the_post_thumbnail( $post->ID, 'medium' ); ?>
		</a>
		</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('digital_enable_excerpt') == 'enable') { ?>
	<div class="entry-content card-text mb-auto">
		<?php
			the_excerpt();
			digital_link_pages();
		?>
	</div><!-- .entry-content -->
	<?php } ?>
</div>

<?php 
if (get_theme_mod('digital_blog_postmeta') !== 'disable') { ?>
<div class="row post-footer">  
		<?php 
			digital_entry_footer();			
		?>		
 <?php if ( 'post' === get_post_type() ) : ?>
				<?php digital_posted_on(); ?>				
		<?php endif; ?>
	   <?php 
	   if (get_theme_mod('digital_blog_viewcount') !== 'disable') {
	   display_post_view_count(); }
	   ?>
		<?php if (get_theme_mod('digital_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('digital_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(); ?> -->
