[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-content/themes/twentynineteen/ -> search.php (source)

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


Generated: Thu Dec 12 01:00:04 2019 Cross-referenced by PHPXref 0.7.1