<?php
/**
 * Template part for displaying results in search pages.
 *
 * @link https://codex.wordpress.org/Template_Hierarchy
 *
 * @package Electromix 
 */
?>
<article id="post-<?php the_ID(); ?>" <?php post_class('post-items'); ?>>
	<figure class="post-image">
		<div class="featured-image">
			<a href="<?php echo esc_url(get_permalink()); ?>" class="lehr_effect">
				<img src="<?php echo esc_url(get_the_post_thumbnail_url()); ?>" alt="<?php the_title(); ?>">
			</a>
			<div class="hover-links">
				<a href="<?php echo esc_url(get_permalink()); ?>" class="blog-share">
					<i class="fa fa-link"></i>
				</a>
			</div>
		</div>
		<div class="post-meta">
			<div class="meta-top">
				<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="2025-08-30" class="meta-info">
							<span class="date"><?php echo esc_html(get_the_date('j')); ?></span>
							<div>
								<span class="month"><?php echo esc_html(get_the_date('M')); ?></span>
								<span class="year"><?php echo esc_html(get_the_date('Y')); ?></span>
							</div>
						</time>
					</a>
				</span>
				<span class="author-name">
					<img src="<?php echo esc_url(get_avatar_url(get_the_author_meta( 'ID' ))); ?>" alt="" >
					<a href="<?php echo esc_url(get_author_posts_url( get_the_author_meta( 'ID' ) ));?>"><?php esc_html(the_author()); ?></a>
				</span>
			</div>
			<div class="meta-bottom">
				<span class="post-tags">
					<i class="fa fa-tags"></i>
					<?php the_tags('',', ',''); ?>
				</span>
				<span class="blog-category">
					<i class="fa fa-folder-open"></i>
					<?php the_category(', '); ?>
				</span>
			</div>
		</div>
	</figure>
	<div class="post-content">
		<?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<span class="screen-reader-text"> "%s"</span> <i class="fa fa-chevron-circle-right"></i>', 'electromix' ),
					esc_html( get_the_title() )
				)
			);
			?>
	</div>
	<div class="post-footer">
		<a href="<?php echo get_comments_link(); ?>" class="comments"><i class="fa fa-comments"></i>(<?php echo get_comments_number(); ?>) <?php echo esc_html__('Comments','electromix'); ?></a>
	</div>
</article>