[ Index ]

PHP Cross Reference of WordPress

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' ) ) ) . '" title="' . esc_attr( get_the_author() ) . '" 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 to
  40                       * rewind the loop back to the beginning that way
  41                       * 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                           * Filter 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                          echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyeleven_author_bio_avatar_size', 60 ) );
  63                          ?>
  64                      </div><!-- #author-avatar -->
  65                      <div id="author-description">
  66                          <h2>
  67                          <?php
  68                              /* translators: author display name */
  69                              printf( __( 'About %s', 'twentyeleven' ), get_the_author() );
  70                          ?>
  71                          </h2>
  72                          <?php the_author_meta( 'description' ); ?>
  73                      </div><!-- #author-description    -->
  74                  </div><!-- #author-info -->
  75                  <?php endif; ?>
  76  
  77                  <?php /* Start the Loop */ ?>
  78                  <?php
  79                  while ( have_posts() ) :
  80                      the_post();
  81                      ?>
  82  
  83                      <?php
  84                          /*
  85                           * Include the Post-Format-specific template for the content.
  86                           * If you want to overload this in a child theme then include a file
  87                           * called content-___.php (where ___ is the Post Format name) and that will be used instead.
  88                           */
  89                          get_template_part( 'content', get_post_format() );
  90                      ?>
  91  
  92                  <?php endwhile; ?>
  93  
  94                  <?php twentyeleven_content_nav( 'nav-below' ); ?>
  95  
  96              <?php else : ?>
  97  
  98                  <article id="post-0" class="post no-results not-found">
  99                      <header class="entry-header">
 100                          <h1 class="entry-title"><?php _e( 'Nothing Found', 'twentyeleven' ); ?></h1>
 101                      </header><!-- .entry-header -->
 102  
 103                      <div class="entry-content">
 104                          <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'twentyeleven' ); ?></p>
 105                          <?php get_search_form(); ?>
 106                      </div><!-- .entry-content -->
 107                  </article><!-- #post-0 -->
 108  
 109              <?php endif; ?>
 110  
 111              </div><!-- #content -->
 112          </section><!-- #primary -->
 113  
 114  <?php get_sidebar(); ?>
 115  <?php get_footer(); ?>


Generated: Thu Jul 18 01:00:03 2019 Cross-referenced by PHPXref 0.7.1