Skip to:
Content
Pages
Categories
Search
Top
Bottom

Create two different sizes of Avatars


  • Henry
    Participant

    @henrybaum

    A question from someone who doesn’t know a lot about what he’s doing with code. I want to create two different Avatar sizes – one for the profile and one for when there’s a listing via Buddypress Links that needs a different ratio (book covers).

    I’ve defined this in bp-core-avatars.php

    if ( !defined( ‘BP_AVATAR_BOOK_WIDTH’ ) )

    define( ‘BP_AVATAR_BOOK_WIDTH’, 150 );

    if ( !defined( ‘BP_AVATAR_BOOK_HEIGHT’ ) )

    define( ‘BP_AVATAR_BOOK_HEIGHT’, 190 );

    But I’m not sure what else I need to configure – if it’s simple or requires many different tweaks. Is it here?

    if ( $width )

    $html_width = ” width='{$width}'”;

    else

    $html_width = ( ‘thumb’ == $type ) ? ‘ width=”‘ . BP_AVATAR_THUMB_WIDTH . ‘”‘ : ‘ width=”‘ . BP_AVATAR_FULL_WIDTH . ‘”‘;

    if ( $height )

    $html_height = ” height='{$height}'”;

    else

    $html_height = ( ‘thumb’ == $type ) ? ‘ height=”‘ . BP_AVATAR_THUMB_HEIGHT . ‘”‘ : ‘ height=”‘ . BP_AVATAR_FULL_HEIGHT . ‘”‘;

    Thanks.

  • The topic ‘Create two different sizes of Avatars’ is closed to new replies.
Skip to toolbar