Skip to:

author avatar inside the post

  • johnny-two-hands


    I’m looking to see the author’s avatar inside the post (single.php)

    I have tried:

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    <?php bp_wire_post_author_name() ?>

    but it does not work.. you see the same avatar for all authors :(

    I guess there may be some problem with the loop

    any help would be appreciated, thx

Viewing 8 replies - 1 through 8 (of 8 total)

  • johnny-two-hands


    any help… :/

    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:

    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!

    Burt Adsit


    <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>

    The above is from bp-core-directory-members.php. You’ll have to put `$post->post_author in there.

    thanks burtadsit!!!



    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 ) );
    return apply_filters( 'bp_post_author', bp_core_get_userlink( $posts_template->post->post_author ) );

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘author avatar inside the post’ is closed to new replies.
Skip to toolbar