search.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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 Dara
  8. */
  9. get_header(); ?>
  10. <section id="primary" class="content-area">
  11. <main id="main" class="site-main" role="main">
  12. <?php
  13. if ( have_posts() ) : ?>
  14. <header class="page-header">
  15. <h1 class="page-title"><?php printf( esc_html__( 'Search Results for: %s', 'dara' ), '<span>' . get_search_query() . '</span>' ); ?></h1>
  16. </header>
  17. <?php
  18. /* Start the Loop */
  19. while ( have_posts() ) : the_post();
  20. /**
  21. * Run the loop for the search to output the results.
  22. * If you want to overload this in a child theme then include a file
  23. * called content-search.php and that will be used instead.
  24. */
  25. get_template_part( 'components/post/content', 'search' );
  26. endwhile;
  27. the_posts_navigation();
  28. else :
  29. get_template_part( 'components/post/content', 'none' );
  30. endif; ?>
  31. </main>
  32. </section>
  33. <?php
  34. get_sidebar();
  35. get_footer();