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 );

Leave a Reply