search.php 1.1 KB

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