WordPress函数:the_author_link 显示当前作者链接

江河/ 2023年04月30日/ WordPress/ 浏览 732

函数原型:


the_author_link()


如果作者设置了主页,则回显HTML链接,否则只回显作者的姓名。


函数源码:


function the_author_link() {
	echo get_the_author_link();
}


使用举例:


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


此示例将作者的网站URL显示为链接,链接的文本为作者的配置文件显示名称。在本例中,作者的显示名称是James Smith。


结果为:


<p>Written by: <a href="http://example.com" rel="nofollow">James Smith</a></p>


发表评论

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

客服 工单