Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
/**
* The template for displaying search results pages.
*
* @package _s
*/
get_header(); ?>
<div id="primary" class="contents-search-results">
<main id="main" class="site-main ctn-main" role="main">
<?php if ( have_posts() ) : ?>
<header class="page-header">
<h1 class="page-title"><?php printf( esc_html__( 'Search Results', '_s' )); ?></h1>
<p class="search-results-numbers">
<?php
global $wp_query;
$total_results = $wp_query->found_posts;
echo ('About <span class="totalnb">' . $total_results . '</span> Results');
?> (<?php echo timer_stop( $display = 0, $precision = 3 ); ?> seconds)
</p>
</header><!-- .page-header -->
<div class="search-results-ajax">
<?php while ( have_posts() ) : the_post(); ?>
<?php
/**
* 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/content', 'search' );
?>
<?php endwhile; ?>
</div>
<div id="load-more-results" class="load-more"><a href="#" target="_self">More Results<i class="fa fa-angle-down fa-2x"></i></a></a></div>
<?php //the_posts_navigation(); ?>
<?php else : ?>
<?php get_template_part( 'template-parts/content', 'none' ); ?>
<?php endif; ?>
</main><!-- #main -->
</div><!-- #primary -->
<?php get_footer(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.