<?php
/**
 * Template part for displaying page content in page.php.
 *
 * @link https://codex.wordpress.org/Template_Hierarchy
 *
 * @package Glides
 */
$categories = get_the_category();
?>
	<article id="post-<?php the_ID(); ?>" <?php post_class('post-item'); ?>>
		<?php if ( has_post_thumbnail() ) { ?>
			<figure class="post-image ">	
				<?php the_post_thumbnail('medium'); ?>
				<div class="meta top">
					<span class="date">
						<a href="#"><?php echo esc_html(get_the_date('j')); ?><span><?php echo esc_html(get_the_date('M')); ?></span></a>
					</span>
				</div>
			</figure>
		<?php } ?>
	
		<div class="post-content">
			<div class="meta">
				<span class="admin"><a href="<?php echo esc_url(get_author_posts_url(get_the_author_meta('ID'))) ?>" title="<?php echo esc_url(get_avatar_url(get_the_author_meta( 'name' ))) ?>"><i class="fa fa-user"></i> <?php esc_html(the_author()); ?></a></span>
				<?php if ($categories) { ?>
				<span class="Category"><a href="#"><i class="fa fa-folder-open"></i> <?php the_category(',',''); ?></a></span>
				<?php } if(has_tag()){ ?>
					<span class="tags"><a href="#"><i class="fa fa fa-tags"></i> <?php the_tags('',''); ?></a></span>
				<?php } ?>
			</div>
			<?php    
				the_title( sprintf( '<h2 class="post-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' );
				the_excerpt();
			?>
			<a href="<?php echo esc_url(get_permalink()) ?>" target="_blank" class="btn btn-border-4"><?php echo esc_html__('Read More','glides'); ?> </a>
		</div>
	</article>