<?php

/**
 * Template part for displaying posts
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
 *
 * @package Zenith Blog
 */
$archive_classes = 'blog-post-single grid-design grid-style-3';
$button_label    = get_theme_mod( 'zenith_blog_readmore_button_label', __( 'Read More', 'zenith-blog' ) );
?>

<article id="post-<?php the_ID(); ?>" <?php post_class( esc_attr( $archive_classes ) ); ?>>
		<?php zenith_blog_post_thumbnail(); ?>
		<div class="mag-post-category">
			<?php zenith_blog_categories_list(); ?>
		</div>
		<?php
		if ( is_singular() ) :
			the_title( '<h1 class="entry-title mag-post-title">', '</h1>' );
		else :
			the_title( '<h2 class="entry-title mag-post-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );
		endif;
		?>
		<div class="mag-post-meta">
			<?php
			zenith_blog_posted_by();
			zenith_blog_posted_on();
			?>
			<span class="post-views">
				<i class="far fa-eye"></i>
				<?php echo getPostViews( get_the_ID() ); ?>
			</span>
		</div>
		<div class="mag-post-excerpt">
			<?php the_excerpt(); ?>
		</div>
		<div class="ascen-btn-read">
			<div class="ascen-readmore-btn">
				<a href="<?php the_permalink(); ?>"><?php echo esc_html( $button_label ); ?></a>
			</div>
			<div class="ascen-min-read">
				<i class="far fa-clock"></i>
				<span>
					<?php
					echo zenith_blog_reading_time( get_the_content() );
					echo esc_html__( ' min read', 'zenith-blog' );
					?>
				</span>
			</div>
		</div>
</article><!-- #post-<?php the_ID(); ?> -->
