search.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 Seedlet
  9. * @since 1.0.0
  10. */
  11. get_header();
  12. ?>
  13. <section id="primary" class="content-area">
  14. <main id="main" class="site-main" role="main">
  15. <?php if ( have_posts() ) : ?>
  16. <header class="page-header default-max-width">
  17. <?php
  18. printf(
  19. /* translators: 1: search result title. 2: search term. */
  20. '<h1 class="page-title">%1$s <span class="page-description search-term">%2$s</span></h1>',
  21. __( 'Search results for:', 'seedlet' ),
  22. get_search_query()
  23. );
  24. ?>
  25. </header><!-- .page-header -->
  26. <?php
  27. // Start the Loop.
  28. while ( have_posts() ) :
  29. the_post();
  30. /*
  31. * Include the Post-Format-specific template for the content.
  32. * If you want to override this in a child theme, then include a file
  33. * called content-___.php (where ___ is the Post Format name) and that will be used instead.
  34. */
  35. get_template_part( 'template-parts/content/content-excerpt' );
  36. // End the loop.
  37. endwhile;
  38. // Numbered pagination.
  39. seedlet_the_posts_pagination();
  40. // If no content, include the "No posts found" template.
  41. else :
  42. get_template_part( 'template-parts/content/content-none' );
  43. endif;
  44. ?>
  45. </main><!-- #main -->
  46. </section><!-- #primary -->
  47. <?php
  48. get_footer();