]> scripts.mit.edu Git - autoinstalls/wordpress.git/blob - wp-content/themes/twentyfifteen/search.php
WordPress 4.7.2-scripts
[autoinstalls/wordpress.git] / wp-content / themes / twentyfifteen / search.php
1 <?php
2 /**
3  * The template for displaying search results pages.
4  *
5  * @package WordPress
6  * @subpackage Twenty_Fifteen
7  * @since Twenty Fifteen 1.0
8  */
9
10 get_header(); ?>
11
12         <section id="primary" class="content-area">
13                 <main id="main" class="site-main" role="main">
14
15                 <?php if ( have_posts() ) : ?>
16
17                         <header class="page-header">
18                                 <h1 class="page-title"><?php printf( __( 'Search Results for: %s', 'twentyfifteen' ), get_search_query() ); ?></h1>
19                         </header><!-- .page-header -->
20
21                         <?php
22                         // Start the loop.
23                         while ( have_posts() ) : the_post(); ?>
24
25                                 <?php
26                                 /*
27                                  * Run the loop for the search to output the results.
28                                  * If you want to overload this in a child theme then include a file
29                                  * called content-search.php and that will be used instead.
30                                  */
31                                 get_template_part( 'content', 'search' );
32
33                         // End the loop.
34                         endwhile;
35
36                         // Previous/next page navigation.
37                         the_posts_pagination( array(
38                                 'prev_text'          => __( 'Previous page', 'twentyfifteen' ),
39                                 'next_text'          => __( 'Next page', 'twentyfifteen' ),
40                                 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentyfifteen' ) . ' </span>',
41                         ) );
42
43                 // If no content, include the "No posts found" template.
44                 else :
45                         get_template_part( 'content', 'none' );
46
47                 endif;
48                 ?>
49
50                 </main><!-- .site-main -->
51         </section><!-- .content-area -->
52
53 <?php get_footer(); ?>