<?php
/**
 * Template part for displaying results in search pages
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
 *
 * @package Byakurai
 */

defined( 'ABSPATH' ) || exit;
?>
	<header>
		<h1 class="page-title">
		<?php
			/* translators: %s: search query. */
			printf( esc_html__( 'Search Results for: %s', 'byakurai' ), '<span>' . get_search_query() . '</span>' );
		?>
		</h1>
	</header>
	<?php
	if ( have_posts() ) :
		/* Start the Loop */
		while ( have_posts() ) {
			the_post();
			?>
			<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
				<header class="entry-header">
					<?php the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' ); ?>

					<?php if ( 'post' === get_post_type() ) : ?>
					<div class="entry-meta">
						<?php
						byakurai_posted_on();
						byakurai_posted_by();
						?>
					</div><!-- .entry-meta -->
					<?php endif; ?>
				</header><!-- .entry-header -->

				<?php byakurai_post_thumbnail(); ?>

				<div class="entry-summary">
					<?php the_excerpt(); ?>
				</div><!-- .entry-summary -->

				<footer class="entry-footer">
					<?php byakurai_entry_footer(); ?>
				</footer><!-- .entry-footer -->
			</article><!-- #post-<?php the_ID(); ?> -->
			<?php
		}
		the_posts_pagination();
	else :
		get_template_part( 'template-parts/content', 'none' );
	endif;
