Skip to content

Instantly share code, notes, and snippets.

@shahadat014
Created January 18, 2015 19:09
Show Gist options
  • Select an option

  • Save shahadat014/0d7f1652f0e04d05fd5d to your computer and use it in GitHub Desktop.

Select an option

Save shahadat014/0d7f1652f0e04d05fd5d to your computer and use it in GitHub Desktop.
Get author post count inside & outside loop , Inside loop: First get user id, Then get post count in loop
$author_id= get_the_author_meta('ID');
echo count_user_posts( $author_id );
Outside loop
echo count_user_posts( 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment