Find Answers and Get Support › Forums › Armadon – Gaming Community WordPress Theme › Website Setup › Pages › BuddyPress Profile Avatars
- This topic has 8 replies, 2 voices, and was last updated 3 years, 3 months ago by
Manathan.
-
AuthorPosts
-
@themodactyl
- 0 Topics
- 6751 Posts
Hi Alongar,
Indeed, BuddyPress uses Gravatar by default. However, not everyone has a Gravatar account, especially in a community website. To prevents the user to have a blank avatar, our theme set a default one to each member, like the one in your screenshot.
Be aware that you can allow your users to set an avatar directly from your website. Can you please go to Dashboard > Settings > BuddyPress > Options > Members Settings and make sure the feature “Allow registered members to upload avatars” is checked? Please find the attached screenshot.
Thank to this feature, you will not have this gravatar message displayed and your users will be able to set an avatar more easily.
Let me know if you need more explanations.
Best,
January 20, 2022 at 10:12 #38233AlongarParticipant@alongar- 40 Topics
- 113 Posts
Just an update
I overridden the theme’s default avatar by creating a bp-custom.php file and using these constants:
define ( 'BP_AVATAR_DEFAULT', $img_url ); define ( 'BP_AVATAR_DEFAULT_THUMB', $img_url );
This snippet works and overrides the theme’s default avatar photo.
However, while using those constants, I wanted BuddyPress to use Gravatar if a user has one so I also added this constant:
add_filter( 'bp_core_avatar_default', function() { return BP_AVATAR_DEFAULT; } );
It does not display users Gravatar’s and only displays the default image constant that I set in the override. So not sure where to go from there. And still the HTML code is showing in the Change Profile Photo tab. Any ideas on how to fix that issue? Is it theme related?
January 20, 2022 at 17:19 #38236AlongarParticipant@alongar- 40 Topics
- 113 Posts
*Update 2*
I fixed the issue with the message displaying the HTML code link to Gravatar. The issue was with the Grimlock BuddyPress Plugin under the change-avatar.php file (grimlock-buddypress/templates/members/single/profile/change-avatar.php). On line 75 the code is:
<p><?php esc_html_e( ‘Your profile photo will be used on your profile and throughout the site. To change your profile photo, please create an account with <a href=”https://gravatar.com”>Gravatar</a> using the same email address as you used to register with this site.’, ‘buddypress’ ); ?></p>
The first part should be <?php _e not <php esc_html_e.
The fixed code is:
<p><?php _e( 'Your profile photo will be used on your profile and throughout the site. To change your profile photo, please create an account with <a href="https://gravatar.com">Gravatar</a> using the same email address as you used to register with this site.', 'buddypress' ); ?></p>
So basically, my only issue now is Gravatars not showing if users have registered emails with gravatar.com and register to the site using that email. I changed the default avatar using the constants I posted in the previous comment and have it to where BuddyPress should be pulling user Gravatars if they have one instead of displaying the default avatar.
January 21, 2022 at 03:57 #38241@themodactyl- 0 Topics
- 6751 Posts
Hi Carm,
Thank you for your patience.
To allow your users to use Gravatar, simply add the following code snippet to your website:
/** * Activate Gravatar */ add_filter( 'bp_core_fetch_avatar_no_grav', '__return_false', 100 );
To add this code snippet to your site, we recommend that you use the Code Snippets plugin (https://wordpress.org/plugins/code-snippets/). If you have never activated this plugin, please read the following post: Adding Custom PHP Without Changing Your Child Theme.
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.
Concerning the html code link to Gravatar, it seems there is definitely an issue in our theme which will be fixed in the next update. We thank you for sharing the solution with us. I’m sure it will help other users facing the same issue. By doing this, you will be making a great contribution to this forum, and we thank you very much for that! #SharingIsCaring 💪🏻
We’ll be back to you as soon as the update is available.
Best,
January 26, 2022 at 15:48 #38348@themodactyl- 0 Topics
- 6751 Posts
Hi Carm,
We have just released a new update of Grimlock for BuddyPress. Updating this plugin to the latest version should hide the Gravatar notice.
After the update, the problem should now be fixed. However, you might still be seeing the issue because your browser cache is showing you an older version of the page (browsers do that to load pages faster). To see that the issue is resolved you will need to empty your browser cache and reload the page. If you want to read more on what browser cache is and how to clear it, here is an article that might help you: How to Clear Internet Cache in Every Major Browser.
Kindest regards,
February 4, 2022 at 10:19 #38549 -
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 ‘BuddyPress Profile Avatars’ is closed to new replies.