我想统计特定类别中的作者帖子数量。我该怎么做?我把这根线染红了,但还是洗不出来。
Count number of posts by author in a category
编辑:这是我得到并尝试过的,但根本不起作用。$user_id = get_the_author_meta(\'ID\')
$args = array(
\'author_name\' => $user_id,
\'category_name\' => \'categoryname\',
};
$wp_query = new WP_Query($args);
while ( $wp_query->have_posts() ) : $wp_query->the_post();
echo $my_count = $wp_query->post_count;
wp_reset_postdata();
endwhile;