search.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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 Rebalance
  8. */
  9. get_header(); ?>
  10. <div 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', 'rebalance' ), '<span>' . get_search_query() . '</span>' ); ?></h1>
  15. </header><!-- .page-header -->
  16. <div id="infinite-wrap">
  17. <?php /* Start the Loop */ ?>
  18. <?php while ( have_posts() ) : the_post(); ?>
  19. <?php
  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( 'template-parts/content', 'card' );
  26. ?>
  27. <?php endwhile; ?>
  28. <?php the_posts_navigation(); ?>
  29. </div><!-- #infinite-wrap -->
  30. <?php else : ?>
  31. <?php get_template_part( 'template-parts/content', 'none' ); ?>
  32. <?php endif; ?>
  33. </main><!-- #main -->
  34. </div><!-- #primary -->
  35. <?php get_sidebar(); ?>
  36. <?php get_footer(); ?>