search.php 1.1 KB

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