We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Code to change the size of the avatar? | Forum

Rebecca-Jayne
Rebecca-Jayne Nov 22 '15
Hey,


Can anyone please tell me the code to alter the size of a member's avatar on their profile? I've changed it on the Admin panel but a lot of members don't seem happy with the modification so was just wondering if there was a way for members to change the size of their avatars.

Thanks.

Darryl B Leader
Darryl B Nov 22 '15
Members wouldn't be able to do that. The avatars are displayed in a set container that can only be changed through css adjustments. You would need to adjust the container, and the photo size, and would most likely need to use the "!important" tag since the base css will try to size the avatar to the default sizes. There are several avatar images defined. Be sure your working with the right one.
Tecca
Tecca Nov 22 '15
I think the easiest solution is to use the design settings plugin and have your members paste some CSS to change the avatar size. Everybody that visits a specific profile will see the avatar as the size that the person set in their CSS.


In the custom CSS box in that plugin, you'd paste the following if you're using the Simplicity theme:


div#avatar_console_image {

    height: 80px !important;

    width: 80px !important

}


Or this for the older theme:


div#avatar-console > div {

    background-size: 80px 80px !important;

}


Then the user can change the height and width px value to make the avatar larger or smaller on their profile. If you're using a different theme, it can probably be done, you'd just need to take a look at the avatar CSS.


EDIT: I haven't used that plugin, but I did test in on his demo site. Worked fine.

The Forum post is edited by Tecca Nov 22 '15