説明なし

search.php 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 WordPress
  8. * @subpackage Twenty_Nineteen
  9. * @since Twenty Nineteen 1.0
  10. */
  11. get_header();
  12. ?>
  13. <div id="primary" class="content-area">
  14. <main id="main" class="site-main">
  15. <?php if ( have_posts() ) : ?>
  16. <header class="page-header">
  17. <h1 class="page-title">
  18. <?php _e( 'Search results for: ', 'twentynineteen' ); ?>
  19. <span class="page-description"><?php echo get_search_query(); ?></span>
  20. </h1>
  21. </header><!-- .page-header -->
  22. <?php
  23. // Start the Loop.
  24. while ( have_posts() ) :
  25. the_post();
  26. /*
  27. * Include the Post-Format-specific template for the content.
  28. * If you want to override this in a child theme, then include a file
  29. * called content-___.php (where ___ is the Post Format name) and that
  30. * will be used instead.
  31. */
  32. get_template_part( 'template-parts/content/content', 'excerpt' );
  33. // End the loop.
  34. endwhile;
  35. // Previous/next page navigation.
  36. twentynineteen_the_posts_navigation();
  37. // If no content, include the "No posts found" template.
  38. else :
  39. get_template_part( 'template-parts/content/content', 'none' );
  40. endif;
  41. ?>
  42. </main><!-- #main -->
  43. </div><!-- #primary -->
  44. <?php
  45. get_footer();