
WordPress函数文件Functions.php教程指南:定义、使用、替代方案及实例
get_the_author_posts ( No parameters )
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 ); }