[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

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

   1  <?php
   2  /**
   3   * The 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                      /* Queue the first post, that way we know
  19                       * what author we're dealing with (if that is the case).
  20                       *
  21                       * We reset this later so we can run the loop
  22                       * properly with a call to rewind_posts().
  23                       */
  24                      the_post();
  25                  ?>
  26  
  27                  <header class="page-header">
  28                      <h1 class="page-title author"><?php 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" ) ) ) . '" title="' . esc_attr( get_the_author() ) . '" rel="me">' . get_the_author() . '</a></span>' ); ?></h1>
  29                  </header>
  30  
  31                  <?php
  32                      /* Since we called the_post() above, we need to
  33                       * rewind the loop back to the beginning that way
  34                       * we can run the loop properly, in full.
  35                       */
  36                      rewind_posts();
  37                  ?>
  38  
  39                  <?php twentyeleven_content_nav( 'nav-above' ); ?>
  40  
  41                  <?php
  42                  // If a user has filled out their description, show a bio on their entries.
  43                  if ( get_the_author_meta( 'description' ) ) : ?>
  44                  <div id="author-info">
  45                      <div id="author-avatar">
  46                          <?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyeleven_author_bio_avatar_size', 60 ) ); ?>
  47                      </div><!-- #author-avatar -->
  48                      <div id="author-description">
  49                          <h2><?php printf( __( 'About %s', 'twentyeleven' ), get_the_author() ); ?></h2>
  50                          <?php the_author_meta( 'description' ); ?>
  51                      </div><!-- #author-description    -->
  52                  </div><!-- #author-info -->
  53                  <?php endif; ?>
  54  
  55                  <?php /* Start the Loop */ ?>
  56                  <?php while ( have_posts() ) : the_post(); ?>
  57  
  58                      <?php
  59                          /* Include the Post-Format-specific template for the content.
  60                           * If you want to overload this in a child theme then include a file
  61                           * called content-___.php (where ___ is the Post Format name) and that will be used instead.
  62                           */
  63                          get_template_part( 'content', get_post_format() );
  64                      ?>
  65  
  66                  <?php endwhile; ?>
  67  
  68                  <?php twentyeleven_content_nav( 'nav-below' ); ?>
  69  
  70              <?php else : ?>
  71  
  72                  <article id="post-0" class="post no-results not-found">
  73                      <header class="entry-header">
  74                          <h1 class="entry-title"><?php _e( 'Nothing Found', 'twentyeleven' ); ?></h1>
  75                      </header><!-- .entry-header -->
  76  
  77                      <div class="entry-content">
  78                          <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'twentyeleven' ); ?></p>
  79                          <?php get_search_form(); ?>
  80                      </div><!-- .entry-content -->
  81                  </article><!-- #post-0 -->
  82  
  83              <?php endif; ?>
  84  
  85              </div><!-- #content -->
  86          </section><!-- #primary -->
  87  
  88  <?php get_sidebar(); ?>
  89  <?php get_footer(); ?>


Generated: Fri May 25 03:56:23 2012 Hosted by follow the white rabbit.