Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to increase activity-avatar image size?

  • Avatar of 21cdb
    21cdb
    Participant

    @21cdb

    I found the default size of the activity-avatar image is created in buddypress/bp-activity/bp-activity-templatetags.php.

    On line 238 is a funtion which determines the default image size of 20px x 20px.

    function bp_get_activity_avatar( $args = '' ) {
    global $bp, $activities_template;

    $defaults = array(
    'type' => 'thumb',
    'width' => 20,
    'height' => 20,
    'class' => 'avatar',
    'alt' => __( 'Avatar', 'buddypress' )
    );

    Is there an easy way to change these values without touching the bp core files? Can i use some hook or filter in bp-custom.php?

Viewing 10 replies - 1 through 10 (of 10 total)
  • Avatar of Tore
    Tore
    Participant

    @toregus

    I’d like to know this too.

    The only thing I’ve learnt is that you can create a bp-custom.php and place it in /wp-content/.

    Avatar of Tore
    Tore
    Participant

    @toregus

    Avatar of Tore
    Tore
    Participant

    @toregus

    I wanted to edit the forums avatar and could edit this:

    ‘<?php bp_the_topic_last_poster_avatar( ‘type=thumb&width=50&height=50′ ) ?>’

    You can find it in the theme /directories/forums/forums-loop.php.

    Avatar of 21cdb
    21cdb
    Participant

    @21cdb

    Hey Tore thanks for the hints, however i want to change the size of the activity avatar WITHOUT touching the bp core files.

    I have still no answer if it’s possible to do so by adding some lines of code to bp-custom.php, so if u know a method which isn’t altering the core files i would appreciate ur solution!

    Avatar of Tore
    Tore
    Participant

    @toregus

    Hi!

    In the example above I’m altering the forum poster avatar and am changing the size with with and height. So it works without editing core. Try if you can get the same effect with the function you are using.

    This is not a question of editing bp-core but the specific theme file. I was for example editing:

    theme_name/directories/forums/forums-loop.php.

    You’ll have to edit some theme file at least.

    Avatar of 21cdb
    21cdb
    Participant

    @21cdb

    But i’m trying to alter the activity-stream widget that comes with buddypress. The “template” file is located at buddypress/bp-activity/bp-activity-templatetags.php which is in the core directory.

    I could copy the plugin code and hard code it in my home.php but then i would have to track the edits Andy and the other developer are doing to the activity stream plugin.

    I would need a filter or hook to change the activity-stream widget avatar size.

    Hey @21cdb, did you have any luck with this issue of resizing avatars? I’m also looking for a solution to the same issue.

    Thanks!

    @21cdb and @lucianop were u guys able to resize the avatars?

    Avatar of @mercime
    @mercime
    Keymaster

    @mercime

    Two kinds of avatars in activity stream can be adjusted very simply via CSS

    1) For the large avatars – adjust image width and height, then add this to the bottom of your stylesheet
    `ul.item-list li img.avatar {
    height: 100px;
    width: 100px;
    }`

    2) For small avatars with the minor updates, adjust avatar image to preferred height and width then add this at the bottom of stylesheet
    `.activity-list li.mini .activity-avatar img.avatar,
    .activity-list li.mini .activity-avatar img.FB_profile_pic {
    height: 100px;
    width: 100px;
    }`

    Avatar of otreva
    otreva
    Participant

    @otreva

    @mercime

    For #1 above, that works, however that just resizes a 35 x 35 image via CSS to 100×100 making it look very pixelated and blurry.

    Here is an example for the BP Members Widget on how to change the sizing without the image being blurry:

    http://www.otreva.com/blog/buddypress-how-to-change-avatar-size-larger-or-smaller/

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

You must be logged in to reply to this topic.