search.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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 Shoreditch
  8. */
  9. get_header(); ?>
  10. <div class="site-content-wrapper">
  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', 'shoreditch' ), '<span>' . get_search_query() . '</span>' ); ?></h1>
  17. </header><!-- .page-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-search.php and that will be used instead.
  25. */
  26. get_template_part( 'template-parts/content', 'search' );
  27. endwhile;
  28. the_posts_navigation();
  29. else :
  30. get_template_part( 'template-parts/content', 'none' );
  31. endif; ?>
  32. </main><!-- #main -->
  33. </section><!-- #primary -->
  34. <?php get_sidebar(); ?>
  35. </div><!-- .site-content-wrapper -->
  36. <?php
  37. get_sidebar( 'footer' );
  38. get_footer();