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

?>

<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
	<header class="entry-header">
		<?php benqu_category_badge();?>
		<?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
		<div class="pfy-single-post-meta">
			<ul>
				<li><i class="fal fa-user-alt"></i> <?php the_author()?></li>
				<li><i class="fal fa-calendar-alt"></i> <?php echo esc_html(get_the_time( get_option('date_format')));?></li>
				<li><i class="fal fa-comments"></i> 
					<?php echo esc_attr(get_comments_number());?> 
					<?php
					if(get_comments_number() == 1){
						esc_html_e( 'Comment', 'benqu' );
					}else{
						esc_html_e( 'Comments', 'benqu' );
					}						 
					?>
				</li>

				<?php if(function_exists('benqu_get_views')):?>
					<li><i class="fal fa-eye"></i> <?php echo esc_attr(benqu_get_views());?> <?php esc_html_e( 'Views', 'benqu' );?></li>
				<?php endif;?>

			</ul>
		</div>
	</header><!-- .entry-header -->
	<div class="pfy-single-post-thumb">
		<?php the_post_thumbnail( 'benqu-img-size4', ['class' => 'img-fluid'] ); ?>
	</div>

	<div class="entry-content">
		<?php
		the_content(
			sprintf(
				wp_kses(
					/* translators: %s: Name of current post. Only visible to screen readers */
					__( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'benqu' ),
					array(
						'span' => array(
							'class' => array(),
						),
					)
				),
				wp_kses_post( get_the_title() )
			)
		);

		wp_link_pages(
			array(
				'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'benqu' ),
				'after'  => '</div>',
			)
		);
		?>
	</div><!-- .entry-content -->

	<footer class="entry-footer">
		<div class="row align-items-center">
			<div class="col-lg-6 col-6">
				<?php benqu_entry_footer(); ?>
			</div>
			<div class="col-lg-6 col-6 text-end">
				<?php 
					if(function_exists('benqu_post_share')){
						benqu_post_share();
					} 
				?>
			</div>
		</div>
		
	</footer><!-- .entry-footer -->
</article><!-- #post-<?php the_ID(); ?> -->
