[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

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

   1  <?php
   2  /**
   3   * The template for displaying Search Results pages
   4   *
   5   * @package WordPress
   6   * @subpackage Twenty_Twelve
   7   * @since Twenty Twelve 1.0
   8   */
   9  
  10  get_header(); ?>
  11  
  12      <section id="primary" class="site-content">
  13          <div id="content" role="main">
  14  
  15          <?php if ( have_posts() ) : ?>
  16  
  17              <header class="page-header">
  18                  <h1 class="page-title">
  19                  <?php
  20                  /* translators: %s: Search query. */
  21                  printf( __( 'Search Results for: %s', 'twentytwelve' ), '<span>' . get_search_query() . '</span>' );
  22                  ?>
  23                  </h1>
  24              </header>
  25  
  26              <?php twentytwelve_content_nav( 'nav-above' ); ?>
  27  
  28              <?php
  29              // Start the Loop.
  30              while ( have_posts() ) :
  31                  the_post();
  32                  ?>
  33                  <?php get_template_part( 'content', get_post_format() ); ?>
  34              <?php endwhile; ?>
  35  
  36              <?php twentytwelve_content_nav( 'nav-below' ); ?>
  37  
  38          <?php else : ?>
  39  
  40              <article id="post-0" class="post no-results not-found">
  41                  <header class="entry-header">
  42                      <h1 class="entry-title"><?php _e( 'Nothing Found', 'twentytwelve' ); ?></h1>
  43                  </header>
  44  
  45                  <div class="entry-content">
  46                      <p><?php _e( 'Sorry, but nothing matched your search criteria. Please try again with some different keywords.', 'twentytwelve' ); ?></p>
  47                      <?php get_search_form(); ?>
  48                  </div><!-- .entry-content -->
  49              </article><!-- #post-0 -->
  50  
  51          <?php endif; ?>
  52  
  53          </div><!-- #content -->
  54      </section><!-- #primary -->
  55  
  56  <?php get_sidebar(); ?>
  57  <?php get_footer(); ?>


Generated: Thu Nov 21 01:00:03 2024 Cross-referenced by PHPXref 0.7.1