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