WordPress 4.7.2-scripts
[autoinstalls/wordpress.git] / wp-content / themes / twentysixteen / single.php
1 <?php
2 /**
3  * The template for displaying all single posts and attachments
4  *
5  * @package WordPress
6  * @subpackage Twenty_Sixteen
7  * @since Twenty Sixteen 1.0
8  */
9
10 get_header(); ?>
11
12 <div id="primary" class="content-area">
13         <main id="main" class="site-main" role="main">
14                 <?php
15                 // Start the loop.
16                 while ( have_posts() ) : the_post();
17
18                         // Include the single post content template.
19                         get_template_part( 'template-parts/content', 'single' );
20
21                         // If comments are open or we have at least one comment, load up the comment template.
22                         if ( comments_open() || get_comments_number() ) {
23                                 comments_template();
24                         }
25
26                         if ( is_singular( 'attachment' ) ) {
27                                 // Parent post navigation.
28                                 the_post_navigation( array(
29                                         'prev_text' => _x( '<span class="meta-nav">Published in</span><span class="post-title">%title</span>', 'Parent post link', 'twentysixteen' ),
30                                 ) );
31                         } elseif ( is_singular( 'post' ) ) {
32                                 // Previous/next post navigation.
33                                 the_post_navigation( array(
34                                         'next_text' => '<span class="meta-nav" aria-hidden="true">' . __( 'Next', 'twentysixteen' ) . '</span> ' .
35                                                 '<span class="screen-reader-text">' . __( 'Next post:', 'twentysixteen' ) . '</span> ' .
36                                                 '<span class="post-title">%title</span>',
37                                         'prev_text' => '<span class="meta-nav" aria-hidden="true">' . __( 'Previous', 'twentysixteen' ) . '</span> ' .
38                                                 '<span class="screen-reader-text">' . __( 'Previous post:', 'twentysixteen' ) . '</span> ' .
39                                                 '<span class="post-title">%title</span>',
40                                 ) );
41                         }
42
43                         // End of the loop.
44                 endwhile;
45                 ?>
46
47         </main><!-- .site-main -->
48
49         <?php get_sidebar( 'content-bottom' ); ?>
50
51 </div><!-- .content-area -->
52
53 <?php get_sidebar(); ?>
54 <?php get_footer(); ?>