wp/wp-content/themes/twentytwelve/author.php
changeset 0 d970ebf37754
child 5 5e2f62d02dcd
equal deleted inserted replaced
-1:000000000000 0:d970ebf37754
       
     1 <?php
       
     2 /**
       
     3  * The template for displaying Author Archive pages
       
     4  *
       
     5  * Used to display archive-type pages for posts by an author.
       
     6  *
       
     7  * @link http://codex.wordpress.org/Template_Hierarchy
       
     8  *
       
     9  * @package WordPress
       
    10  * @subpackage Twenty_Twelve
       
    11  * @since Twenty Twelve 1.0
       
    12  */
       
    13 
       
    14 get_header(); ?>
       
    15 
       
    16 	<section id="primary" class="site-content">
       
    17 		<div id="content" role="main">
       
    18 
       
    19 		<?php if ( have_posts() ) : ?>
       
    20 
       
    21 			<?php
       
    22 				/* Queue the first post, that way we know
       
    23 				 * what author we're dealing with (if that is the case).
       
    24 				 *
       
    25 				 * We reset this later so we can run the loop
       
    26 				 * properly with a call to rewind_posts().
       
    27 				 */
       
    28 				the_post();
       
    29 			?>
       
    30 
       
    31 			<header class="archive-header">
       
    32 				<h1 class="archive-title"><?php printf( __( 'Author Archives: %s', 'twentytwelve' ), '<span class="vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( "ID" ) ) ) . '" title="' . esc_attr( get_the_author() ) . '" rel="me">' . get_the_author() . '</a></span>' ); ?></h1>
       
    33 			</header><!-- .archive-header -->
       
    34 
       
    35 			<?php
       
    36 				/* Since we called the_post() above, we need to
       
    37 				 * rewind the loop back to the beginning that way
       
    38 				 * we can run the loop properly, in full.
       
    39 				 */
       
    40 				rewind_posts();
       
    41 			?>
       
    42 
       
    43 			<?php twentytwelve_content_nav( 'nav-above' ); ?>
       
    44 
       
    45 			<?php
       
    46 			// If a user has filled out their description, show a bio on their entries.
       
    47 			if ( get_the_author_meta( 'description' ) ) : ?>
       
    48 			<div class="author-info">
       
    49 				<div class="author-avatar">
       
    50 					<?php
       
    51 					/**
       
    52 					 * Filter the author bio avatar size.
       
    53 					 *
       
    54 					 * @since Twenty Twelve 1.0
       
    55 					 *
       
    56 					 * @param int $size The height and width of the avatar in pixels.
       
    57 					 */
       
    58 					$author_bio_avatar_size = apply_filters( 'twentytwelve_author_bio_avatar_size', 68 );
       
    59 					echo get_avatar( get_the_author_meta( 'user_email' ), $author_bio_avatar_size );
       
    60 					?>
       
    61 				</div><!-- .author-avatar -->
       
    62 				<div class="author-description">
       
    63 					<h2><?php printf( __( 'About %s', 'twentytwelve' ), get_the_author() ); ?></h2>
       
    64 					<p><?php the_author_meta( 'description' ); ?></p>
       
    65 				</div><!-- .author-description	-->
       
    66 			</div><!-- .author-info -->
       
    67 			<?php endif; ?>
       
    68 
       
    69 			<?php /* Start the Loop */ ?>
       
    70 			<?php while ( have_posts() ) : the_post(); ?>
       
    71 				<?php get_template_part( 'content', get_post_format() ); ?>
       
    72 			<?php endwhile; ?>
       
    73 
       
    74 			<?php twentytwelve_content_nav( 'nav-below' ); ?>
       
    75 
       
    76 		<?php else : ?>
       
    77 			<?php get_template_part( 'content', 'none' ); ?>
       
    78 		<?php endif; ?>
       
    79 
       
    80 		</div><!-- #content -->
       
    81 	</section><!-- #primary -->
       
    82 
       
    83 <?php get_sidebar(); ?>
       
    84 <?php get_footer(); ?>