Find Answers and Get Support › Forums › Cera – Intranet & Community Theme › Popular Features › Member Directory › how to I change the default avatar guy?
- This topic has 17 replies, 4 voices, and was last updated 4 years, 5 months ago by
Manathan.
-
AuthorPosts
-
@themosaurusrex
- 0 Topics
- 2048 Posts
Hi @2tara,
We are aware of this limitation with the default avatars and we’re planning on addressing this by making it editable in the Customizer.
@youfriend is correct, this is the easiest way to do it. If you wish to know more about child themes, please also read the following post:Otherwise, if you wish to use code to change this, simply add the following snippet to your website:
/** * Changing the default Cera avatars. */ if ( function_exists( 'buddypress' ) ) { if ( ! class_exists( 'Youzer' ) ) { define( 'BP_AVATAR_DEFAULT', 'YOURWEBSITE/SOME-DIRECTORIES/user-avatar.png' ); define( 'BP_AVATAR_DEFAULT_THUMB', 'YOURWEBSITE/SOME-DIRECTORIES/user-avatar-thumb.png' ); } }
To add this code snippet to your site, we recommend that you use a the Code Snippets plugin (https://wordpress.org/plugins/code-snippets/). If you have never activated this plugin, please read the following post:
Please also note that we don’t provide any theme customization. So, you shouldn’t expect other snippets from us unless it’s to fix an issue stemming from our own codebase. We always try our best to help theme users whenever we can and only provide code snippets out of courtesy to prevent them from waiting for the next update.
Regards,
May 13, 2020 at 11:19 #12679@themosaurusrex- 0 Topics
- 2048 Posts
You’re welcome @youfriend! This is an awesome plugin if do not wish to build a child theme for minor changes. I’m glad to read that this recommendation might help you!
May 14, 2020 at 10:53 #12704AndreaParticipant@youfriend- 26 Topics
- 133 Posts
Hey @themosaurusrex
this code for default avatar profile work fine, and now i use code snippet instead childtheme. Wat about code for groups avatar default?
May 27, 2020 at 07:49 #13170@themosaurusrex- 0 Topics
- 2048 Posts
@youfriend Could you try to add the following snippet please?
if ( function_exists( 'buddypress' ) ) { /** * Change the default BP group avatar image. * * @param string $avatar The URL for the default BP group avatar image. * @param array $params The array of params for the default BP group avatar image. * * @return string The updated URL for the BP group avatar image. */ function cera_custom_change_default_avatar_group( $avatar, $params ) { $avatar = 'YOURWEBSITE/SOME-DIRECTORIES/user-group.png'; return $avatar; } add_filter( 'bp_core_default_avatar_group', 'cera_custom_change_default_avatar_group', 10, 2 ); }
Thank you.
May 27, 2020 at 15:47 #13217@themosaurusrex- 0 Topics
- 2048 Posts
@youfriend I’m sorry, the code priority was way too high and thus the code was running before theme. Could replace the snippet from https://support.themosaurus.com/forums/topic/how-to-i-change-the-default-avatar-guy/#post-13217
With the following:
if ( function_exists( 'buddypress' ) ) { /** * Change the default BP group avatar image. * * @param string $avatar The URL for the default BP group avatar image. * @param array $params The array of params for the default BP group avatar image. * * @return string The updated URL for the BP group avatar image. */ function cera_custom_change_default_avatar_group( $avatar, $params ) { $avatar = 'https://www.gravatar.com/avatar/?d=mp&s=72'; return $avatar; } add_filter( 'bp_core_default_avatar_group', 'cera_custom_change_default_avatar_group', 1000, 2 ); }
It do the trick. (Please see attached.)
May 28, 2020 at 13:13 #13249@themosaurusrex- 0 Topics
- 2048 Posts
@youfriend Could post a screenshot of your widgets please? This change is the same as those made by Grimlock for BuddyPress, it should work in both cases. Thank you.
May 28, 2020 at 13:15 #13250May 28, 2020 at 15:57 #13266@themosaurusrex- 0 Topics
- 2048 Posts
@youfriend Thank you very much for your precious feedback. My understanding is that BuddyPress is bypassing our snippet each time it uses AJAX to load new data from your server.
We will investigate further to find from where this issue is coming from.
We will be back to you ASAP.
Thank you for your patience.
May 29, 2020 at 21:23 #13306@themosaurusrex- 0 Topics
- 2048 Posts
Just for know if possible, or i’ll back with child-theme. My users asked me why this strange avatar appear sometimes ?
@youfriend Very sorry about this. I’m glad to read that they’re keeping their sense of humor. 😀This should be solved very soon(ish). Grimlock for BuddyPress v 1.3.5 will be release next week. This has been included in the task list for v 1.3.6.
Hopefully, you won’t wait for too long now.
June 27, 2020 at 14:09 #14309@themosaurusrex- 0 Topics
- 2048 Posts
We’re very sorry, this task has been postponed yet again, the good news is that it is currently in the pipeline and WILL be included with v 1.3.8.
Again sorry, and thank you for your patience.
August 17, 2020 at 11:35 #16250@themodactyl- 0 Topics
- 6690 Posts
August 19, 2020 at 12:30 #16383 -
AuthorPosts
Hi there,
This topic has been inactive for a while now so we will be closing it to keep the forum tidy. Don't hesitate to create a new topic if you still need help and we'll be glad to help you!
Best regards,
The Themosaurus team.
The topic ‘how to I change the default avatar guy?’ is closed to new replies.