Skip to:
Content
Pages
Categories
Search
Top
Bottom

Resizing Avatars


  • Rescue Themes
    Participant

    @rescuethemes

    I’m hoping someone can help with locating “post_author_avatar_link” for me as well. I suspect the bbpress structure has changed since this answer was provided because I’m unable to locate the folders mentioned.

    Thanks in advance.

Viewing 1 replies (of 1 total)

  • Rescue Themes
    Participant

    @rescuethemes

    I was able to locate bbp_single_user_details_avatar_size in bbpress/templates/default/bbpress/user-details.php which eventually lead me to the following function that accomplishes what I needed (resizing the avatar):

    
    function my_bbp_change_avatar_size($author_avatar, $topic_id, $size) {
        $author_avatar = '';
        if ($size == 14) {
            $size = 24;
        }
        if ($size == 80) {
            $size = 110;
        }
        $topic_id = bbp_get_topic_id( $topic_id );
        if ( !empty( $topic_id ) ) {
            if ( !bbp_is_topic_anonymous( $topic_id ) ) {
                $author_avatar = get_avatar( bbp_get_topic_author_id( $topic_id ), $size );
            } else {
                $author_avatar = get_avatar( get_post_meta( $topic_id, '_bbp_anonymous_email', true ), $size );
            }
        }
        return $author_avatar;
    }
    
    /* Add priority (default=10) and number of arguments */
    add_filter('bbp_get_topic_author_avatar', 'my_bbp_change_avatar_size', 20, 3);
    add_filter('bbp_get_reply_author_avatar', 'my_bbp_change_avatar_size', 20, 3);
    add_filter('bbp_get_current_user_avatar', 'my_bbp_change_avatar_size', 20, 3);
    

    Increase avatar size in bbpress

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