content-author.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /**
  3. * The template for displaying Author Bio
  4. *
  5. * @package Button 2
  6. */
  7. if ( ! is_single() ) {
  8. return;
  9. }
  10. ?>
  11. <div class="entry-author">
  12. <div class="author-avatar">
  13. <?php
  14. /**
  15. * Filter the author bio avatar size.
  16. *
  17. * @param int $size The avatar height and width size in pixels.
  18. */
  19. $author_bio_avatar_size = apply_filters( 'button_2_author_bio_avatar_size', 80 );
  20. echo get_avatar( get_the_author_meta( 'user_email' ), $author_bio_avatar_size );
  21. ?>
  22. </div><!-- .author-avatar -->
  23. <div class="author-heading">
  24. <h2 class="author-title"><?php printf( esc_html__( 'Published by %s', 'button-2' ), '<span class="author-name">' . get_the_author() . '</span>' ); ?></h2>
  25. </div><!-- .author-heading -->
  26. <p class="author-bio">
  27. <?php the_author_meta( 'description' ); ?>
  28. <a class="author-link" href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" rel="author">
  29. <?php printf( esc_html__( 'View all posts by %s', 'button-2' ), get_the_author() ); ?>
  30. </a>
  31. </p><!-- .author-bio -->
  32. </div><!-- .entry-auhtor -->