search.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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 Radcliffe 2
  8. */
  9. get_header(); ?>
  10. <section id="primary" class="content-area">
  11. <main id="main" class="site-main">
  12. <?php
  13. if ( have_posts() ) : ?>
  14. <header class="page-header">
  15. <h1 class="page-title"><?php
  16. /* translators: %s: search query. */
  17. printf( esc_html__( 'Search Results for: %s', 'radcliffe-2' ), '<span>' . get_search_query() . '</span>' );
  18. ?></h1>
  19. </header><!-- .page-header -->
  20. <?php
  21. /* Start the Loop */
  22. while ( have_posts() ) : the_post();
  23. /**
  24. * Run the loop for the search to output the results.
  25. * If you want to overload this in a child theme then include a file
  26. * called content-search.php and that will be used instead.
  27. */
  28. get_template_part( 'template-parts/content', 'search' );
  29. endwhile;
  30. the_posts_navigation( array(
  31. 'prev_text' => radcliffe_2_get_svg( array( 'icon' => 'previous' ) ) . esc_html__( 'Older Posts', 'radcliffe-2' ),
  32. 'next_text' => esc_html__( 'Newer Posts', 'radcliffe-2' ) . radcliffe_2_get_svg( array( 'icon' => 'next' ) ),
  33. ) );
  34. else :
  35. get_template_part( 'template-parts/content', 'none' );
  36. endif; ?>
  37. </main><!-- #main -->
  38. </section><!-- #primary -->
  39. <?php
  40. get_sidebar();
  41. get_footer();