How to Get WordPress Author ID by Post ID
You can get wordpress author id by post id like that. Using the get_post_field() function, we can extract the post_author field with the $post_id variable. Other fields we can extract post_content, post_author, post_title, post_name (slug), post_excerpt, post_status, comment_status, post_parent, post_type, comment_count, post_date, ping_status, post_modified and etc.
$author_id = get_post_field( 'post_author', $post_id );