Get the latest trunk first.
<?php bp_post_author_avatar() ?>
<?php bp_comment_author_avatar() ?>
i looked function u’ve done and now im using this:
<?php echo bp_core_get_avatar( $post->post_author, 1 );?>
because <?php bp_post_author_avatar() ?> doesn’t work at all, u can see here:
http://img34.picoodle.com/img/img34/3/12/5/f_bppostauthom_266aa82.gif
thanks
That will also work, it’s just a little more difficult. The function I mentioned before should work now, I left some debug code in there.
I got my avatar to show up in the single post using <?php bp_post_author_avatar() ?>
but what code would i need to add to make it click into the authors profile in buddypress?
Thanks for your help!
Also, amazing work on buddypress Andy!
<div class="item-avatar">
<a href="<?php echo bp_core_get_userlink( $user->user_id, false, true ) ?>">
<?php echo bp_core_get_avatar( $user->user_id, 1 ) ?></a>
</div>
The above is from bp-core-directory-members.php. You’ll have to put `$post->post_author in there.
I use such code for post author url for BP:
<a href='/members/<?php the_author(); ?>'><?php the_author(); ?></a>
But i can’t get post authors username used in BP, not default login name from WP..
For example i have WP the_author = admin, but BP post_author = yu. My question is how to get bp_post_author name?
I got this func, but can’t get it work for me:
function bp_post_author( $echo = true ) {
global $posts_template;
if ( $echo )
echo apply_filters( 'bp_post_author', bp_core_get_userlink( $posts_template->post->post_author ) );
else
return apply_filters( 'bp_post_author', bp_core_get_userlink( $posts_template->post->post_author ) );
}