Skip to:
Content
Pages
Categories
Search
Top
Bottom

[bbpress 2 plugin] – How to change default avatar size? (to match Buddypress)


  • Laughing Cat
    Participant

    @laughing-cat

    I’ve set in buddypress a full avatar width/height size as 150px (full sized).

    My bbpress 2.x forum installation, however, has set by default 80px forum avatar images

    How can I set the avatar size for the forum threads to be the same as buddypress?

    thank you

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

  • Laughing Cat
    Participant

    @laughing-cat

    no clues? is there any filter I can use to alter the default bbPress avatar size, just like in Buddypress? or replace the function calling the avatar in my template files to use avatars of a different size?

    thank you


    engin1984
    Participant

    @engin1984

    <?php post_author_avatar_link(32); ?>


    Laughing Cat
    Participant

    @laughing-cat

    if I use that in bbpress templates I get:

    Call to undefined function post_author_avatar_link()


    Laughing Cat
    Participant

    @laughing-cat

    this function:

    bbp_reply_author_link( array( ‘sep’ => ”, ‘size’ => ‘150’ ) );

    actually resizes the avatar to the desired size

    HOWEVER, it fetches the buddypress thumbnail avatar – in my case uses the 50px thumbnail and stretches it to 150px, which is ugly

    I want to fetch the 150px (full width buddypress avatar ) and display as it is…


    Laughing Cat
    Participant

    @laughing-cat

    I got this solution… which is probably not so clean but it works; previously I had already created a function to retrieve the full width bp avatar in wordpress, now I looked at the bbp code and filtered the function fetching the avatar in replies with that function I had previously created

    function sg_author_avatar($size) {
    global $post;
    if ( function_exists('bp_core_fetch_avatar') ) {
    echo apply_filters( 'bp_post_author_avatar', bp_core_fetch_avatar( array( 'item_id' => $post->post_author, 'type' => 'full', 'height' => $size, 'width' => $size ) ) );
    }
    elseif ( function_exists('get_avatar') ) {
    echo get_avatar(get_the_author_meta('ID'), $size );
    }
    }

    function sg_bp2bb_author_avatar() {
    $author_avatar = sg_author_avatar('150');
    }
    add_filter('bbp_get_reply_author_avatar', 'sg_bp2bb_author_avatar')


    Laughing Cat
    Participant

    @laughing-cat

    ach, just now I thought this would have fixed it

    instead in the single-forum view under the freshness coulumn, I get some last poster pictures sized 14px (default) and some other at full size

    I have no idea why this is happening, and looks very random…

    sigh, I wish this whole thing was easier to accomplish…


    Laughing Cat
    Participant

    @laughing-cat

    Anyone?


    nchiari
    Participant

    @nchiari

    UP


    atburi
    Participant

    @aburi

    Looking to solve the same issue 🙂


    Tecca
    Participant

    @tecca

    I haven’t been able to figure this out either, so I set the “BP_AVATAR_THUMB_WIDTH” in my functions.php file to 120. I figure I won’t been needing small avatar thumbnails anyway, so I’ll just go with slightly larger ones as default.

Viewing 10 replies - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.