search.php 1.1 KB

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