search.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php declare( strict_types = 1 ); ?>
  2. <?php
  3. /**
  4. * The template for displaying search results pages
  5. *
  6. * @link https://developer.wordpress.org/themes/basics/template-hierarchy/#search-result
  7. *
  8. * @package WordPress
  9. * @subpackage Varia
  10. * @since 1.0.0
  11. */
  12. get_header();
  13. ?>
  14. <section id="primary" class="content-area">
  15. <main id="main" class="site-main">
  16. <?php if ( have_posts() ) : ?>
  17. <header class="page-header responsive-max-width">
  18. <?php
  19. printf(
  20. /* translators: 1: search result title. 2: search term. */
  21. '<h1 class="page-title">%1$s <span class="page-description search-term">%2$s</span></h1>',
  22. __( 'Search results for:', 'varia' ),
  23. get_search_query()
  24. );
  25. ?>
  26. </header><!-- .page-header -->
  27. <?php
  28. // Start the Loop.
  29. while ( have_posts() ) :
  30. the_post();
  31. /*
  32. * Include the Post-Format-specific template for the content.
  33. * If you want to override this in a child theme, then include a file
  34. * called content-___.php (where ___ is the Post Format name) and that will be used instead.
  35. */
  36. get_template_part( 'template-parts/content/content', 'excerpt' );
  37. // End the loop.
  38. endwhile;
  39. // Previous/next page navigation.
  40. varia_the_posts_navigation();
  41. // If no content, include the "No posts found" template.
  42. else :
  43. get_template_part( 'template-parts/content/content', 'none' );
  44. endif;
  45. ?>
  46. </main><!-- #main -->
  47. </section><!-- #primary -->
  48. <?php
  49. get_footer();