[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-content/themes/twentyten/ -> author.php (source)

   1  <?php
   2  /**
   3   * Template for displaying Author Archive pages
   4   *
   5   * @package WordPress
   6   * @subpackage Twenty_Ten
   7   * @since Twenty Ten 1.0
   8   */
   9  
  10  get_header(); ?>
  11  
  12          <div id="container">
  13              <div id="content" role="main">
  14  
  15  <?php
  16      /*
  17       * Queue the first post, that way we know who
  18       * the author is when we try to get their name,
  19       * URL, description, avatar, etc.
  20       *
  21       * We reset this later so we can run the loop
  22       * properly with a call to rewind_posts().
  23       */
  24  if ( have_posts() ) {
  25      the_post();
  26  }
  27  ?>
  28  
  29                  <h1 class="page-title author">
  30                  <?php
  31                  /* translators: %s: author display name */
  32                  printf( __( 'Author Archives: %s', 'twentyten' ), '<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>' );
  33                  ?>
  34                  </h1>
  35  
  36  <?php
  37  // If a user has filled out their description, show a bio on their entries.
  38  if ( get_the_author_meta( 'description' ) ) :
  39      ?>
  40                      <div id="entry-author-info">
  41                          <div id="author-avatar">
  42                              <?php
  43                              /**
  44                               * Filter the Twenty Ten author bio avatar size.
  45                               *
  46                               * @since Twenty Ten 1.0
  47                               *
  48                               * @param int The height and width avatar dimensions in pixels. Default 60.
  49                               */
  50                              echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyten_author_bio_avatar_size', 60 ) );
  51                              ?>
  52                          </div><!-- #author-avatar -->
  53                          <div id="author-description">
  54                              <h2>
  55                              <?php
  56                              /* translators: %s: author display name */
  57                              printf( __( 'About %s', 'twentyten' ), get_the_author() );
  58                              ?>
  59                              </h2>
  60                              <?php the_author_meta( 'description' ); ?>
  61                          </div><!-- #author-description    -->
  62                      </div><!-- #entry-author-info -->
  63  <?php endif; ?>
  64  
  65  <?php
  66      /*
  67       * Since we called the_post() above, we need to
  68       * rewind the loop back to the beginning that way
  69       * we can run the loop properly, in full.
  70       */
  71      rewind_posts();
  72  
  73      /*
  74       * Run the loop for the author archive page to output the authors posts
  75       * If you want to overload this in a child theme then include a file
  76       * called loop-author.php and that will be used instead.
  77       */
  78      get_template_part( 'loop', 'author' );
  79  ?>
  80              </div><!-- #content -->
  81          </div><!-- #container -->
  82  
  83  <?php get_sidebar(); ?>
  84  <?php get_footer(); ?>


Generated: Fri Jul 19 01:00:04 2019 Cross-referenced by PHPXref 0.7.1