Skip to content

Instantly share code, notes, and snippets.

@danemorgan
Created September 14, 2013 05:20
Show Gist options
  • Save danemorgan/6559017 to your computer and use it in GitHub Desktop.
Save danemorgan/6559017 to your computer and use it in GitHub Desktop.
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);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment