Skip to:
Content
Pages
Categories
Search
Top
Bottom

How do I insert the big avatar?

  • Hello!

    I’m currently modyfying my WP theme and I want to insert the big avatar (150×150) on the comment page. I’ve tried this code:

    …but that only insert the thumb avatar. How do I get the big avatar instead?

    /Woolwich

    (Sorry for my bad english, I hope you’ll understand me) :)

Viewing 14 replies - 1 through 14 (of 14 total)
  • I’m looking for a way to do this as well. Anyone?

    Avatar of Marcella
    Marcella
    Participant

    @marcella1981

    If it is an activity template you are looking for the avatar, that should be the one.

    Thanks, Marcella! But I get no output from this at all. I’m trying to insert the avatar into the blog’s sidebar. Get_avatar() produces the thumbnail version in this context, but bp_activity_avatar() produces no output.

    Avatar of Marcella
    Marcella
    Participant

    @marcella1981

    Is this for a WordPress blog comment or a BuddyPress activity comment / group comment / status update / anything BuddyPress?

    If WordPress query the codex for params http://codex.wordpress.org/Function_Reference/get_avatar

    `<?php
    echo get_avatar
    (
    ‘user-id-which-you-can-find-in-users-table-or-user-email’,
    ‘size-in-numeric-form’,
    ‘path-to-avatar-if-none-supplied-will-use-mystery-man,
    ‘alt-text-for-image-goes-between’
    );
    ?>`

    If it’s BuddyPress and you are using outside a loop then there are also parameters you can pass. However documentation here is a little sparser than the WordPress Codex.

    It’s in a WordPress context. Unfortunately, get_avatar() accepts a size parameter, but simply scales the thumbnail rather than fetching the full-sized image. There must be a way to retrieve the full-sized image?

    Avatar of Marcella
    Marcella
    Participant

    @marcella1981

    Oh I don’t know of this, you’d have to query Gravatar and find out if they allow for you to query the original. Surely it can be done.

    Apologies for mis-interpreting here.

    No worries, thanks for your help. I know BP is storing the full-sized avatar somewhere, I just don’t know where or how to get to it.

    By the way, gravatar does indeed allow you to grab large images (http://en.gravatar.com/site/implement/images/), but most users on my Buddypress site don’t like to use their gravatars for profile images.

    Avatar of @mercime
    @mercime
    Keymaster

    @mercime

    Build a child theme of bp-default theme http://codex.buddypress.org/theme-development/building-a-buddypress-child-theme/

    Size of the avatar in comments is handled by bp-default theme’s `function bp_dtheme_blog_comments`

    Create a new functions.php file for your child theme if you haven’t one yet and add the following to the file http://pastebin.com/cSQ1gGm8

    Adjust avatar size (I made it 150px for original comment and 100px for replies to comment) then save and upload to your child theme folder. Change avatar sizes to preferred sizes. You would also need to adjust CSS of comments section accordingly.

    Thanks, mercime, but I’m not sure I understand. I’m not trying to change the size of avatars in the comments section, but rather in the sidebar for a multi-user buddypress site.

    I see that in your code you’re using bp_core_fetch_avatar(). That function seems to produce the same output as get_avatar() for me — which is the avatar thumbnail scaled to whatever size I specify. Am I missing something?

    Just bumping this topic to see if anyone may know a solution.

    Avatar of adambundy
    adambundy
    Member

    @adambundy

    Im looking for this solution as well- basically how to echo the avatar URL ending with ‘-bpfull.jpg’ rather than ‘-bpthumb.jpg’. Anyone know how to accomplish this? thanks!

    Avatar of adambundy
    adambundy
    Member

    @adambundy

    I found a solution for this. Hope it helps someone. Note that I am fetching the value of $user_id earlier in my loop.

    `if ( function_exists(‘bp_core_fetch_avatar’) ) {
    echo apply_filters( ‘bp_post_author_avatar’, bp_core_fetch_avatar( array( ‘item_id’ => $user_id, ‘type’ => ‘full’, ‘width’ => 120, ‘height’ => 120 ) ) );
    } else if ( function_exists(‘get_avatar’) ) {
    get_avatar( $user_id, $size = ’120′);
    }`

    Avatar of defunctlife
    defunctlife
    Participant

    @defunctlife

    add this to functions.php: it will filter the bbpress function that shows the avatar to switch it to using full.

    `function fix_forum_avatar($author_avatar = false, $reply_id = false, $size = false) {
    echo str_replace(‘-bpthumb’, ‘-bpfull’, $author_avatar );
    }
    add_filter(‘bbp_get_reply_author_avatar’, ‘fix_forum_avatar’);`

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

You must be logged in to reply to this topic.