search.php 1.4 KB

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