search.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. /**
  3. * The template for displaying search results pages.
  4. *
  5. * @package Apostrophe 2
  6. */
  7. get_header(); ?>
  8. <section id="primary" class="content-area">
  9. <?php if ( have_posts() ) : ?>
  10. <header class="page-header">
  11. <h1 class="page-title"><?php printf( esc_html__( 'Search Results for: %s', 'apostrophe-2' ), '<span>' . get_search_query() . '</span>' ); ?></h1>
  12. </header><!-- .page-header -->
  13. <main id="main" class="site-main" role="main">
  14. <div id="posts-wrapper">
  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( 'content', 'search' );
  24. ?>
  25. <?php endwhile; ?>
  26. <?php else : ?>
  27. <?php get_template_part( 'content', 'none' ); ?>
  28. <?php endif; ?>
  29. </div><!-- #posts-wrapper -->
  30. </main><!-- #main -->
  31. <?php the_posts_navigation(); ?>
  32. </section><!-- #primary -->
  33. <?php get_sidebar(); ?>
  34. <?php get_footer(); ?>