get_the_author_posts

函数
get_the_author_posts ( No parameters )
返回值
  • (int) The number of posts by the author.
定义位置
相关方法
get_the_author_posts_linkthe_author_postsget_the_author_msnget_the_authorget_the_author_meta
引入
1.5.0
弃用
-

get_the_author_posts: 该函数检索文章作者所写的已发表文章的数量。它不接受任何参数,并返回一个整数值。

检索当前文章的作者的文章数量。

function get_the_author_posts() {
	$post = get_post();
	if ( ! $post ) {
		return 0;
	}
	return count_user_posts( $post->post_author, $post->post_type );
}

常见问题

FAQs
查看更多 >
闪电侠

(工作日 10:00 - 18:30 为您服务)

2025-12-14 10:36:29

您好,无论是售前、售后、意见建议……均可通过联系工单与我们取得联系。

您也可选择聊天工具与我们即时沟通或点击查看:

您的工单我们已经收到,我们将会尽快跟您联系!
取消
选择聊天工具: