WordPress 4.2
[autoinstalls/wordpress.git] / wp-content / themes / twentyfourteen / author.php
1 <?php
2 /**
3  * The template for displaying Author archive pages
4  *
5  * @link https://codex.wordpress.org/Template_Hierarchy
6  *
7  * @package WordPress
8  * @subpackage Twenty_Fourteen
9  * @since Twenty Fourteen 1.0
10  */
11
12 get_header(); ?>
13
14         <section id="primary" class="content-area">
15                 <div id="content" class="site-content" role="main">
16
17                         <?php if ( have_posts() ) : ?>
18
19                         <header class="archive-header">
20                                 <h1 class="archive-title">
21                                         <?php
22                                                 /*
23                                                  * Queue the first post, that way we know what author
24                                                  * we're dealing with (if that is the case).
25                                                  *
26                                                  * We reset this later so we can run the loop properly
27                                                  * with a call to rewind_posts().
28                                                  */
29                                                 the_post();
30
31                                                 printf( __( 'All posts by %s', 'twentyfourteen' ), get_the_author() );
32                                         ?>
33                                 </h1>
34                                 <?php if ( get_the_author_meta( 'description' ) ) : ?>
35                                 <div class="author-description"><?php the_author_meta( 'description' ); ?></div>
36                                 <?php endif; ?>
37                         </header><!-- .archive-header -->
38
39                         <?php
40                                         /*
41                                          * Since we called the_post() above, we need to rewind
42                                          * the loop back to the beginning that way we can run
43                                          * the loop properly, in full.
44                                          */
45                                         rewind_posts();
46
47                                         // Start the Loop.
48                                         while ( have_posts() ) : the_post();
49
50                                                 /*
51                                                  * Include the post format-specific template for the content. If you want to
52                                                  * use this in a child theme, then include a file called called content-___.php
53                                                  * (where ___ is the post format) and that will be used instead.
54                                                  */
55                                                 get_template_part( 'content', get_post_format() );
56
57                                         endwhile;
58                                         // Previous/next page navigation.
59                                         twentyfourteen_paging_nav();
60
61                                 else :
62                                         // If no content, include the "No posts found" template.
63                                         get_template_part( 'content', 'none' );
64
65                                 endif;
66                         ?>
67
68                 </div><!-- #content -->
69         </section><!-- #primary -->
70
71 <?php
72 get_sidebar( 'content' );
73 get_sidebar();
74 get_footer();