[ 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                              $author_bio_avatar_size = apply_filters( 'twentyten_author_bio_avatar_size', 60 );
  51                              echo get_avatar( get_the_author_meta( 'user_email' ), $author_bio_avatar_size );
  52                              ?>
  53                          </div><!-- #author-avatar -->
  54                          <div id="author-description">
  55                              <h2>
  56                              <?php
  57                              /* translators: %s: Author display name. */
  58                              printf( __( 'About %s', 'twentyten' ), get_the_author() );
  59                              ?>
  60                              </h2>
  61                              <?php the_author_meta( 'description' ); ?>
  62                          </div><!-- #author-description    -->
  63                      </div><!-- #entry-author-info -->
  64  <?php endif; ?>
  65  
  66  <?php
  67      /*
  68       * Since we called the_post() above, we need to
  69       * rewind the loop back to the beginning that way
  70       * we can run the loop properly, in full.
  71       */
  72      rewind_posts();
  73  
  74      /*
  75       * Run the loop for the author archive page to output the authors posts
  76       * If you want to overload this in a child theme then include a file
  77       * called loop-author.php and that will be used instead.
  78       */
  79      get_template_part( 'loop', 'author' );
  80  ?>
  81              </div><!-- #content -->
  82          </div><!-- #container -->
  83  
  84  <?php get_sidebar(); ?>
  85  <?php get_footer(); ?>


Generated: Fri Nov 22 01:00:04 2019 Cross-referenced by PHPXref 0.7.1