author.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. get_header();
  3. ?>
  4. <div class="author_info">
  5. <div class="avatar" data-post-count="<?php echo count_user_posts(get_the_author_meta('ID'), 'post'); ?>">
  6. <?php echo get_avatar(get_the_author_meta('ID')); ?>
  7. </div>
  8. <div class="author-center">
  9. <h3><?php the_author(); ?></h3>
  10. <div class="description">
  11. <?php
  12. $description = get_the_author_meta('description');
  13. echo $description ? nl2br($description) : __("No personal profile set yet", "sakurairo");
  14. ?>
  15. </div>
  16. </div>
  17. </div>
  18. <style>
  19. .author_info .avatar::after {
  20. content: attr(data-post-count) " \f044"; /* 添加字体图标 */
  21. font-family: 'FontAwesome'; /* 确保使用FontAwesome字体 */
  22. position: absolute;
  23. right: -8px;
  24. bottom: 16px;
  25. background-color: #fff;
  26. padding: 5px;
  27. border-radius: 5px;
  28. font-size: 12px;
  29. color: var(--theme-skin-matching, #505050);
  30. box-shadow: 0 1px 30px -4px #e8e8e8;
  31. background: rgba(255, 255, 255, 0.7);
  32. padding: 2px 8px;
  33. -webkit-transition: all 0.6s ease-in-out;
  34. transition: all 0.6s ease-in-out;
  35. border-radius: 16px;
  36. border: 1px solid #FFFFFF;
  37. backdrop-filter: saturate(180%) blur(10px);
  38. webkit-backdrop-filter: saturate(180%) blur(10px);
  39. }
  40. </style>
  41. <div id="primary" class="content-area">
  42. <main id="main" class="site-main" role="main">
  43. <?php if (have_posts()) : ?>
  44. <?php get_template_part('tpl/content', 'thumb'); ?>
  45. <div class="clearer"></div>
  46. <?php else : ?>
  47. <?php get_template_part('tpl/content', 'none'); ?>
  48. <?php endif; ?>
  49. </main><!-- #main -->
  50. <?php if (iro_opt('pagenav_style') == 'ajax') : ?>
  51. <div id="pagination"><?php next_posts_link(__(' Previous', 'sakurairo')); ?></div>
  52. <div id="add_post"><span id="add_post_time" style="visibility: hidden;" title="<?php echo iro_opt('page_auto_load', ''); ?>"></span></div>
  53. <?php else : ?>
  54. <nav class="navigator">
  55. <?php previous_posts_link('<i class="fa-solid fa-angle-left"></i>'); ?><?php next_posts_link('<i class="fa-solid fa-angle-right"></i>'); ?>
  56. </nav>
  57. <?php endif; ?>
  58. </div><!-- #primary -->
  59. <?php
  60. get_footer();
  61. ?>