search.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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 AltoFocus
  8. */
  9. get_header(); ?>
  10. <div id="primary" class="content-area">
  11. <?php
  12. if ( have_posts() ) : ?>
  13. <header class="page-header">
  14. <h1 class="page-title"><?php printf( esc_html__( 'Search Results for: %s', 'altofocus' ), '<span>' . get_search_query() . '</span>' ); ?></h1>
  15. </header>
  16. <main id="main" class="site-main" role="main">
  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', get_post_format() );
  26. endwhile;
  27. the_posts_navigation(); ?>
  28. </main>
  29. <?php else : ?>
  30. <main id="main" class="site-main" role="main">
  31. <?php get_template_part( 'components/post/content', 'none' ); ?>
  32. </main>
  33. <?php endif; ?>
  34. </div>
  35. <?php
  36. get_footer();