Or even the author id from the post id. I am trying to return the author meta (author page link and avatar) in the sidebar of a single post page (outside of the post loop). What is the best way to do this? I am using a custom function (see below) to return the post id, but am not sure what function to call next.
function this_post_id() {
global $wp_query;
$thePostID = $wp_query->post->ID;
return $thePostID;
}