WordPress函数:the_author_posts 显示当前作者的文章数量

江河/ 2023年05月02日/ WordPress/ 浏览 579

函数原型:


the_author_posts()


显示当前文章作者的文章数量。


需要注意这个函数的迷惑性,只返回数量,并非返回文章列表。


the_author_posts 内部调用了函数 get_the_author_posts,可参考函数 get_the_author_posts 的简介


函数源码:


function the_author_posts() {
	echo get_the_author_posts();
}


使用举例:


<p><?php the_author(); ?> 发布了 <?php the_author_posts(); ?> 篇文章</p>


结果:某某发布了N篇文章。


发表评论

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

客服 工单