<?php
/**
 * Template part for displaying page content in page.php.
 *
 * @link https://codex.wordpress.org/Template_Hierarchy
 *
 * @package Pet Bazaar 
 */
?>
<article id="post-<?php the_ID(); ?>" <?php post_class('post-item'); ?>>
	<?php if ( has_post_thumbnail() ) { ?>
		<figure class="post-image">
			<?php the_post_thumbnail('large', array('class' => 'zoom w-100 d-block h-auto')); ?>
			<div class="post-details">
				<a href="<?php echo esc_url(get_day_link(get_post_time('Y'), get_post_time('m'), get_post_time('j'))); ?>">  <span class="post-date"><?php echo esc_html(get_the_date('j')); ?></span><span class="post-month">  <?php echo esc_html(get_the_date('M')); ?></span></a>
			</div>
		</figure>
	<?php } ?>
	
	<div class="post-content">
		<div class="post-meta">
			<span class="author-name"><a href="<?php echo esc_url(get_author_posts_url(get_the_author_meta('ID'))); ?>"><i class="fa fa-user"></i><?php esc_html(the_author()); ?></a></span>
			<span class="post-comment"><a href="<?php echo get_comments_link(); ?>"><i class="fa fa-comments"></i><?php echo get_comments_number(); ?> Comments</a></span>
		</div>
		<?php 
			if ( is_single() ) :

			the_title('<h5 class="post-title">', '</h5>' );
			
			else:

			the_title( sprintf( '<h5 class="post-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h5>' );
			
			endif;
			
			the_content( 
					sprintf( 
						__( 'Read More <i class="fa fa-long-arrow-right"></i>', 'pet-bazaar' ), 
						'<span class="screen-reader-text">  '.esc_html(get_the_title()).'</span>' 
					) 
				);
		?>
	</div>
</article>