2

I've been scouring everywhere and can't seem to find this. I know the WP variable within the loop can use $post_count but I'm writing from an external function. I've set global wp_query so I should be able to pull out the number, and I have the user IDs as well.

Any help would be more than appreciated :D

Jake
  • 1,285
  • 11
  • 40
  • 119

1 Answers1

3

Take a look at wp-includes/author-template.php. It includes various functions for pulling author data for display in a theme.

In this case, I think you are looking for count_user_posts($userid). If you are retrieving more than just post counts, you may want to create another instance of WP_Query().

gcorne
  • 439
  • 2
  • 5