我需要在 Wordpress 的 single.php 文件中显示帖子的作者。该参考表明 the_author(); 仅在循环内有效。
我一直在寻找其他论坛,但没有找到。
任何想法?
谢谢。
编辑:
<div class="bar_info">
<?php echo "By: ".the_author(); ?>
<?php
foreach((get_the_category()) as $category) {
echo category->cat_name.', ';
}
?>
</div>