<?php
/**
 * The template for displaying search results pages
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/#search-result
 *
 * @package MatrixAddons
 * @subpackage trainify
 * @since 1.0.0
 */

get_header(); 

/*
 * trainify_framework_breadcrumbs_section_template - hook
 *
 * @hooked - trainify_framework_breadcrumbs_section_callback - 10
 *
 * @since 1.0.0
 */
do_action( 'trainify_framework_breadcrumbs_section_template' );
?>
<section id="primary" class="content-area main-content-area">
	<main id="main" class="site-main" role="main">
		<?php
		if ( have_posts() ) : ?>
			<header class="page-header">
				<h1 class="page-title"><?php
				/* translators: %s: search query. */
				printf( esc_html__( 'Search Results for: %s', 'trainify' ), '<span>' . get_search_query() . '</span>' );
				?></h1>
			</header><!-- .page-header -->
			<?php $trainify_search_layout = get_theme_mod( 'trainify_search_layout', 'list' ); ?>
			<div class="trainify-list-items-wrapper  tff-list-<?php echo esc_attr($trainify_search_layout); ?>">
				<?php
				/* Start the Loop */
				while ( have_posts() ) : the_post();
					get_template_part( 'template-parts/listing/content',  $trainify_search_layout );
				endwhile;
				$navigation_type = apply_filters( 'trainify_search_navigation_layout', 'navigation' );
				if($navigation_type=='navigation' ){
					the_posts_navigation();	
				}else{
					do_action('trainify_navigation_template', $navigation_type );
				}
				?>
			</div>
		<?php else :
			get_template_part( 'template-parts/single/content', 'none' );
		endif; ?>
	</main><!-- #main -->
</section><!-- #primary -->
<?php
get_sidebar();
get_footer();