暂无描述

author-bio.php 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * The template for displaying author info below posts.
  4. *
  5. * @package WordPress
  6. * @subpackage Twenty_Twenty_One
  7. * @since Twenty Twenty-One 1.0
  8. */
  9. ?>
  10. <?php if ( (bool) get_the_author_meta( 'description' ) && post_type_supports( get_post_type(), 'author' ) ) : ?>
  11. <div class="author-bio <?php echo get_option( 'show_avatars' ) ? 'show-avatars' : ''; ?>">
  12. <?php echo get_avatar( get_the_author_meta( 'ID' ), '85' ); ?>
  13. <div class="author-bio-content">
  14. <h2 class="author-title">
  15. <?php
  16. printf(
  17. /* translators: %s: Author name. */
  18. esc_html__( 'By %s', 'twentytwentyone' ),
  19. get_the_author()
  20. );
  21. ?>
  22. </h2>
  23. <p class="author-description"> <?php the_author_meta( 'description' ); ?></p><!-- .author-description -->
  24. <?php
  25. printf(
  26. '<a class="author-link" href="%1$s" rel="author">%2$s</a>',
  27. esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
  28. sprintf(
  29. /* translators: %s: Author name. */
  30. esc_html__( 'View all of %s\'s posts.', 'twentytwentyone' ),
  31. get_the_author()
  32. )
  33. );
  34. ?>
  35. </div><!-- .author-bio-content -->
  36. </div><!-- .author-bio -->
  37. <?php endif; ?>