<?php
/**
 * Template part for displaying results in search pages.
 *
 * @link https://codex.wordpress.org/Template_Hierarchy
 *
 * @package Fiona
 */
 ?>
<article class="swiper-slide post-items">
	<figure class="post-image">
		<div class="featured-image">
			<a href="javascript:void(0);" class="blog-img">
				<?php default_section_image('auto',''); ?>
			</a>
			<div class="author-date">
			
				<span class="post-date">
					<a href="<?php echo esc_url(get_day_link(get_post_time('Y'), get_post_time('m'), get_post_time('j'))); ?>">
						<time datetime="<?php echo esc_attr( get_the_date( 'Y-m-d', $post ) ); ?>" class="meta-info">
							<span class="blog-date"><?php echo get_the_date('d', $post); ?></span>
							<span class="month"><?php echo strtoupper( get_the_date('M', $post) ); ?></span>
							<span class="year"><?php echo get_the_date('Y', $post); ?></span>
						</time>
					</a>
				</span>
			
				<a href="<?php echo esc_url(get_author_posts_url( get_the_author_meta( 'ID' ) ));?>" class="post-author">
					<?php echo get_avatar( get_the_author_meta('ID') );?>
				</a>
			
			</div>
		</div>
	</figure>
	<div class="post-content">
		<div class="post-meta">
			<span class="author-name">
				<i class="fa fa-user"></i>
				<a href="<?php echo esc_url(get_author_posts_url( get_the_author_meta( 'ID' ) ));?>"><?php the_author();?></a>
			</span>
			<span class="blog-category">
				<i class="fa fa-folder-open"></i> <?php the_category(', ');?>
			</span>
			<span class="post-tags">
				<i class="fa fa-tags"></i> <?php the_tags('',' ','');?>
			</span>
		</div>
		<?php     
			if ( is_single() ) :
			
			the_title('<h5 class="post-title">', '</h5>' );
			
			else:
			
			the_title( sprintf( '<h5 class="post-title"><a href="%s" class="ellipsis" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h5>' );
			
			endif; 
			
			echo the_content(
				sprintf(
					'<a class="more-link btn" href="%3$s">%1$s<span class="screen-reader-text"> %2$s</span></a>',
					esc_html__('Read More', 'news-25'),
					esc_html(get_the_title()),
					esc_url(get_permalink())
				)
			);

		?> 
	</div>
</article>