Warning: Trying to access array offset on false in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 216
get_the_author_link() - 检索作者的链接或作者的名称 - WordPress函数 - WordPress动力
当前浏览:首页 / WordPress函数 / get_the_author_link()

get_the_author_link()

检索作者的链接或作者的名称


Warning: Undefined array key -1 in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/reference-cat.php on line 185

Warning: Undefined array key 4 in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/reference-cat.php on line 186

Warning: Undefined variable $searchand in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 154

Warning: Undefined array key "650ae00d9c1fad3fccc0887ab9025dcf" in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 223

Warning: Undefined variable $searchand in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 154

Warning: Undefined array key "3743f043ec003c5dec15b1f60f641527" in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 223

Warning: Undefined variable $searchand in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 154

Warning: Undefined array key "da3fa25e51008d111052e4f7cd1619a4" in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 223

author 作者more...

linkmore...

themore...


描述

如果作者设置了主页,则返回HTML链接,否则只返回作者的名称


返回

(string|null) 如果用户meta中存在作者的url,则返回HTML链接,否则为get_the_author()的结果。



源码

查看源码 官方文档


更新日志

版本描述
3.0.0开始引入

使用示例

  • 示例1

    本例将作者的网站URL显示为链接,链接的文本是作者的个人资料显示名称。在本例中,作者的显示名为James Smith。

    <p>Written by: 
    <?php echo get_the_author_link(); ?></p>
    

    显示为:

    Written by: James Smith