-
Author
-
July 30, 2017 at 14:38 #169024allanaParticipant
Hi,
No (default) profile pic is showing before a user uploads their own. So at the moment if i create a profile i am just getting a quesiton mark where the profile pic is (see attachment)
Is there a way of having a default image show up for users who have not uploaded their own?
Thanks!
Attachments:
You must be logged in to view attached files.July 30, 2017 at 16:37 #169036Kieran_SQModeratorHi @allana,
That’s very strange indeed as that image comes from WordPress and you’re getting a 404 error for it. Are you by chance using any plugin or custom code to do with Gravatars or Speed up site by removing X piece of code?
If you’d like to be able to set your own please use the below code in your functions.php file
COPY CODEdefine ( 'BP_AVATAR_DEFAULT', $img_url ); define ( 'BP_AVATAR_DEFAULT_THUMB', $img_url );
An example with a URL is
COPY CODEdefine ( 'BP_AVATAR_DEFAULT', 'http://example.com/default-avatar.jpg' ); define ( 'BP_AVATAR_DEFAULT_THUMB', 'http://example.com/default-avatar-thumb.jpg' );
You can read more on this here: https://codex.buddypress.org/themes/guides/customizing-buddypress-avatars/
Thanks,
Kieran.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionIf you like the theme or the support you've received please consider leaving us a review on Themeforest!
Custom development requests can be sent to dev@seventhqueen.com, one of the development team will be happy to discuss your needs.
July 30, 2017 at 18:01 #169048allanaParticipantHi,
Do you mean: make these changes in the main funtions.php …or the child theme?I tried pasting the code into the child theme and nothing changed :/
July 30, 2017 at 18:14 #169051Kieran_SQModeratorHi,
My apologies I should have said as much. These changes should be added to your child theme’s functions.php
Is this where you added the code?
Kieran.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionIf you like the theme or the support you've received please consider leaving us a review on Themeforest!
Custom development requests can be sent to dev@seventhqueen.com, one of the development team will be happy to discuss your needs.
July 30, 2017 at 18:21 #169053allanaParticipantYeah thats where I added it. Oddly enough, the BP avatiar default image has come back (after uninstalling a plugin) but i still cant set a custom default image.
July 30, 2017 at 18:35 #169054Kieran_SQModeratorHi,
By chance was the plugin Jetpack?
Could you try the code in bp-custom.php and see if that works? You can see how to create this file here https://codex.buddypress.org/themes/bp-custom-php/
Kieran.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionIf you like the theme or the support you've received please consider leaving us a review on Themeforest!
Custom development requests can be sent to dev@seventhqueen.com, one of the development team will be happy to discuss your needs.
July 31, 2017 at 16:23 #169118allanaParticipantCool, i created the bp-custom.php files no problem, but when i entered and saved the code below, the text of the code itself appeared across the top of the page. Did i need to put some kind of tags either side of the code? Sorry, im new to this 🙂
define ( ‘BP_AVATAR_DEFAULT’, ‘http://example.com/default-avatar.jpg’ );
define ( ‘BP_AVATAR_DEFAULT_THUMB’, ‘http://example.com/default-avatar-thumb.jpg’ );July 31, 2017 at 19:31 #169153Kieran_SQModeratorHi,
Sorry for the delay in getting back to you. Sorry to hear it isn’t working for you, please remove the snippet I sent you from functions.php and bp-custom.php and try the following in your child theme’s functions.php
COPY CODE//Custom avatar for no avatar user function myavatar_add_default_avatar( $url ){ return 'http://www.mydomain.com/wp-content/uploads/2014/07/avatarDefault.png'; } add_filter( 'bp_core_mysteryman_src', 'myavatar_add_default_avatar' );
Please replace the path to the image with your own. If that doesn’t work please follow this post on WPMUdev https://premium.wpmudev.org/blog/how-to-add-a-custom-default-avatar-for-buddypress-members-and-groups/
Thanks,
Kieran
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionIf you like the theme or the support you've received please consider leaving us a review on Themeforest!
Custom development requests can be sent to dev@seventhqueen.com, one of the development team will be happy to discuss your needs.
-
AuthorPosts
The forum ‘Bugs & Issues’ is closed to new topics and replies.