search.php 1.0 KB

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