Get the number of posts attributed to a specific author.
function count_posts_by_user($userID) { $userposts = get_posts('showposts=-1&author='.$userID); return count($userposts); }