WordPress函数:the_author 获取当前文章作者

江河/ 2023年04月29日/ WordPress/ 浏览 854

函数原型:


the_author( string $deprecated = '', bool $deprecated_echo = true ): string|null


显示当前文章作者的姓名。


参数 $deprecated 和 $deprecated_echo 的前缀 deprecate 表面这个参数最好不要再使用了。所以,就不介绍这两个参数了。


the_author() 等于 echo get_the_author(),可参考 get_the_author 的简介


使用举例:


// 下面两行代码基本是等价的

the_author();

echo get_the_author();


发表评论

暂无评论,抢个沙发...

客服 工单