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