<?php
/**
 * The template for displaying search results pages
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/#search-result
 *
 * @package WordPress
 * @subpackage WPCargo_Theme_Pro
 * @since 1.0
 * @version 1.0
 */
get_header(); ?>
<div class="wrap">
	<div id="primary" class="content-area">
		<?php if( wpctp_get_option( 'site_layout' ) == 'sidebar-content' ) : ?> 
			<?php get_sidebar(); ?>
		<?php endif; ?>
		<main id="main" class="site-main content wpctp-column" role="main">
		<?php
		if ( have_posts() ) :
			/* Start the Loop */
			while ( have_posts() ) : the_post();
				/**
				 * Run the loop for the search to output the results.
				 * If you want to overload this in a child theme then include a file
				 * called content-search.php and that will be used instead.
				 */
				get_template_part( 'template-parts/post/content', 'excerpt' );
			endwhile; // End of the loop.
echo '<nav class="navigation pagination" role="navigation">';
echo paginate_links( array(
	'type'               => 'list',
) );
echo '</nav>';
		else : ?>
			<p><?php _e( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'wpctp' ); ?></p>
			<?php
				get_search_form();
		endif;
		?>
		</main><!-- #main -->
		<?php if( wpctp_get_option( 'site_layout' ) == 'content-sidebar' ) : ?> 
			<?php get_sidebar(); ?>
		<?php endif; ?>
	</div><!-- #primary -->
</div><!-- .wrap -->
<?php get_footer();
