Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: author avatar inside the post


yu
Participant

@gerbilo

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 ) );
}

Skip to toolbar