企业🤖AI Agent构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
其他页面: ``` <?php /* template name:一般页面 */ ?> ``` 显示文章作者: ``` <?php the_post(); echo get_the_author(); rewind_posts(); ?> ``` 现在作者和作者文章集: ``` <?php the_post(); // queue first post $author_id = get_the_author_meta('ID'); $curauth = get_user_by('ID', $author_id); $user_nicename = $curauth->user_nicename; $display_name = $curauth->display_name; rewind_posts(); // rewind the loop ?> <a href="<?php echo get_author_posts_url($author_id, $user_nicename); ?>"><?php echo $display_name; ?></a> 在 <?php the_time('Y年n月j日, G:i:s'); ?> 发布 / 分类: <?php $categories = get_the_category(); $separator = ", "; $output = ''; if($categories){ foreach ($categories as $category){ $output .= '<a href="' . get_category_link($category->term_id). '">'. $category->cat_name . '</a>'. $separator; } echo trim($output, $separator); } ?> ``` 参考: [https://wp-mix.com/wordpress-get-author-outside-loop/](https://wp-mix.com/wordpress-get-author-outside-loop/) 分享按钮: [https://sharethis.com/](https://sharethis.com/)