tags:

views:

30

answers:

1

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;
}
+1  A: 

I figured it out.

<? $author_id=$post->post_author;?>
<img src="<?php echo  the_author_meta( 'avatar' , "$author_id" ); ?> " width="140" height="140" class="avatar" alt="<?php echo  the_author_meta( 'display_name' , "$author_id" ); ?>" />
<?php echo  the_author_meta( 'user_nicename' , "$author_id" ); ?> 
superUntitled
cool - I'll remove my answer as it's misleading. Glad you sorted it
Kris C