[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

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

   1  <?php
   2  /**
   3   * Template for displaying Author Archive pages
   4   *
   5   * @package WordPress
   6   * @subpackage Twenty_Eleven
   7   * @since Twenty Eleven 1.0
   8   */
   9  
  10  get_header(); ?>
  11  
  12          <section id="primary">
  13              <div id="content" role="main">
  14  
  15              <?php if ( have_posts() ) : ?>
  16  
  17                  <?php
  18                      /*
  19                       * Queue the first post, that way we know what author
  20                       * we're dealing with (if that is the case).
  21                       *
  22                       * We reset this later so we can run the loop properly
  23                       * with a call to rewind_posts().
  24                       */
  25                      the_post();
  26                  ?>
  27  
  28                  <header class="page-header">
  29                      <h1 class="page-title author">
  30                      <?php
  31                      /* translators: %s: Author display name. */
  32                      printf( __( 'Author Archives: %s', 'twentyeleven' ), '<span class="vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '" rel="me">' . get_the_author() . '</a></span>' );
  33                      ?>
  34                      </h1>
  35                  </header>
  36  
  37                  <?php
  38                      /*
  39                       * Since we called the_post() above, we need
  40                       * to rewind the loop back to the beginning.
  41                       * That way we can run the loop properly, in full.
  42                       */
  43                      rewind_posts();
  44                  ?>
  45  
  46                  <?php twentyeleven_content_nav( 'nav-above' ); ?>
  47  
  48                  <?php
  49                  // If a user has filled out their description, show a bio on their entries.
  50                  if ( get_the_author_meta( 'description' ) ) :
  51                      ?>
  52                  <div id="author-info">
  53                      <div id="author-avatar">
  54                          <?php
  55                          /**
  56                           * Filters the Twenty Eleven author bio avatar size.
  57                           *
  58                           * @since Twenty Eleven 1.0
  59                           *
  60                           * @param int The height and width avatar dimension in pixels. Default 60.
  61                           */
  62                          $author_bio_avatar_size = apply_filters( 'twentyeleven_author_bio_avatar_size', 60 );
  63                          echo get_avatar( get_the_author_meta( 'user_email' ), $author_bio_avatar_size );
  64                          ?>
  65                      </div><!-- #author-avatar -->
  66                      <div id="author-description">
  67                          <h2>
  68                          <?php
  69                              /* translators: Author display name. */
  70                              printf( __( 'About %s', 'twentyeleven' ), get_the_author() );
  71                          ?>
  72                          </h2>
  73                          <?php the_author_meta( 'description' ); ?>
  74                      </div><!-- #author-description    -->
  75                  </div><!-- #author-info -->
  76                  <?php endif; ?>
  77  
  78                  <?php
  79                  // Start the Loop.
  80                  while ( have_posts() ) :
  81                      the_post();
  82                      ?>
  83  
  84                      <?php
  85                          /*
  86                           * Include the Post-Format-specific template for the content.
  87                           * If you want to overload this in a child theme then include a file
  88                           * called content-___.php (where ___ is the Post Format name) and that
  89                           * will be used instead.
  90                           */
  91                          get_template_part( 'content', get_post_format() );
  92                      ?>
  93  
  94                  <?php endwhile; ?>
  95  
  96                  <?php twentyeleven_content_nav( 'nav-below' ); ?>
  97  
  98              <?php else : ?>
  99  
 100                  <article id="post-0" class="post no-results not-found">
 101                      <header class="entry-header">
 102                          <h1 class="entry-title"><?php _e( 'Nothing Found', 'twentyeleven' ); ?></h1>
 103                      </header><!-- .entry-header -->
 104  
 105                      <div class="entry-content">
 106                          <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'twentyeleven' ); ?></p>
 107                          <?php get_search_form(); ?>
 108                      </div><!-- .entry-content -->
 109                  </article><!-- #post-0 -->
 110  
 111              <?php endif; ?>
 112  
 113              </div><!-- #content -->
 114          </section><!-- #primary -->
 115  
 116  <?php get_sidebar(); ?>
 117  <?php get_footer(); ?>


Generated : Mon Mar 18 08:20:01 2024 Cross-referenced by PHPXref