Have a look at bb-includes/functions.bb-template.php you’ll see the functions
function get_post_author( $post_id = 0 )and
function post_author_link( $post_id = 0 ).
You’ll need to recreate those in a plugin or in your functions file to use
Have a look at profile.php in your theme to see how it is generated there. But remember that on post.php you’ll have to pass in the ID of the post to get the username otherwise you’ll be fetching details on the logged in user rather post author.
I hope that helps, good luck.
An easier way would be to take away the ability to allow change of display name. Then it will default to username anyway. Have a look at topic/help-with-basic-command-to-add-new-profile-fields if that’s the avenue you want to take. If you do, don’t forget to set everyones ‘nicename’ back to what their username is.
in profile.php i’ve found this <?php echo get_user_name( $user->ID ); ?> but in post.php don’t print nothing… i don’t know bbpress very good to recreate the function
any idea for a simplest way?
$user = bb_get_user( get_post_author_id() );
- You must be logged in to reply to this topic.