search.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. /**
  3. * The template for displaying search results pages.
  4. *
  5. * @link https://developer.wordpress.org/themes/basics/template-hierarchy/#search-result
  6. *
  7. * @package Lodestar
  8. */
  9. get_header(); ?>
  10. <div class="wrap">
  11. <section id="primary" class="content-area">
  12. <main id="main" class="site-main" role="main">
  13. <?php
  14. if ( have_posts() ) : ?>
  15. <header class="page-header">
  16. <h1 class="page-title"><?php printf( esc_html__( 'Search Results for: %s', 'lodestar' ), '<span>' . get_search_query() . '</span>' ); ?></h1>
  17. </header>
  18. <?php
  19. /* Start the Loop */
  20. while ( have_posts() ) : the_post();
  21. /**
  22. * Run the loop for the search to output the results.
  23. * If you want to overload this in a child theme then include a file
  24. * called content-excerpt.php and that will be used instead.
  25. */
  26. get_template_part( 'components/post/content', 'excerpt' );
  27. endwhile;
  28. the_posts_navigation();
  29. else :
  30. get_template_part( 'components/post/content', 'none' );
  31. endif; ?>
  32. </main>
  33. </section>
  34. <?php get_sidebar(); ?>
  35. </div><!-- .wrap -->
  36. <?php
  37. get_footer();