Get author Meta for particular user inside the loop

The function get_the_author_meta('ID') will return the ID of the author for the current post.

That means this line should work.

get_avatar( get_the_author_meta( 'ID' ), 120);

This will not work

get_avatar( get_the_author_meta( '4' ), 120);

Because you are trying to get a property named ‘4’ inside the user object and that property doesn’t exist.

If you wanted to get the avatar for user 4 you would use.

get_avatar( 4, 120);

Because get_avatar takes either a $user_id or $email as the first parameter and the $size as the second.

On a final note the WordPress documentation uses, so check for a formatting error in your html.

get_avatar( get_the_author_meta( 'ID' ), 32 );