[ 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                          $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 /* Start the Loop */ ?>
  79                  <?php
  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 will be used instead.
  89                           */
  90                          get_template_part( 'content', get_post_format() );
  91                      ?>
  92  
  93                  <?php endwhile; ?>
  94  
  95                  <?php twentyeleven_content_nav( 'nav-below' ); ?>
  96  
  97              <?php else : ?>
  98  
  99                  <article id="post-0" class="post no-results not-found">
 100                      <header class="entry-header">
 101                          <h1 class="entry-title"><?php _e( 'Nothing Found', 'twentyeleven' ); ?></h1>
 102                      </header><!-- .entry-header -->
 103  
 104                      <div class="entry-content">
 105                          <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'twentyeleven' ); ?></p>
 106                          <?php get_search_form(); ?>
 107                      </div><!-- .entry-content -->
 108                  </article><!-- #post-0 -->
 109  
 110              <?php endif; ?>
 111  
 112              </div><!-- #content -->
 113          </section><!-- #primary -->
 114  
 115  <?php get_sidebar(); ?>
 116  <?php get_footer(); ?>


Generated: Sat Sep 21 01:00:03 2019 Cross-referenced by PHPXref 0.7.1