-
Author
Tagged: avatar, profile photo, Custom Profile Avatar
-
September 21, 2015 at 22:24 #78832tmh23Participant
Not sure if you can help with this or if its buddypress support. I would like to have a custom default profile load if members don’t upload a profile photo. Currently it is the ‘grey mystery man’. This gets lost on my maps using GeoMyWP. Where can I upload a new default avatar image to be used?
Thanks,
TroyAttachments:
You must be logged in to view attached files.September 22, 2015 at 17:34 #78919RaduModeratorHi,
Just use this function in kleo-child/functions.php
COPY CODE//Custom avatar for no avatar user function myavatar_add_default_avatar( $url ){ return 'http://www.socialagent.me/wp-content/uploads/2014/07/avatarDefault.png'; } add_filter( 'bp_core_mysteryman_src', 'myavatar_add_default_avatar' );
Replace http://www.socialagent.me/wp-content/uploads/2014/07/avatarDefault.png with your default avatar img url.
Regards
Radu
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionMay 18, 2016 at 14:54 #122229lorndalParticipantHi,
the script above works localhost very fine.
But not in my online-community, I´m configurating separatly.A few weeks ago, i´ve changed the avatar options online.( Allow and Forbid personal avatar photos)
At the moment it is set to:
Profile Photo Uploads Allow registered members to upload avatarsOnline, the avatar is complete white.
The Browser sais it would be an image and i can safe it:
425ad04d0137b838ba1c40688324ffc6.png
But this is no real image, when i open the file in photoshop its black and in the file-system its without content.Now I would like to know, where else I could make settings to the avatar, so that the “white” dissappear and the avatarDefault.png shows up?
When I select Profile Photo in the backend, everything works fine. But when I delete the profile photo, the “white” shows up again.
Many thanks
SandraAttachments:
You must be logged in to view attached files.May 18, 2016 at 20:04 #122287RaduModeratorHi,
My suggestion is to re-create a transparent photo with minimum 300x300px width and height or you can choose a default avatar placeholder like this : http://www.clker.com/cliparts/A/Y/O/m/o/N/placeholder-hi.png
Cheers
R.Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionJune 18, 2016 at 12:33 #125978lorndalParticipantHi,
is it possible, to separate between member and group avatars with this script in the function.php, listed above?function myavatar_add_default_avatar( $url ){
return ‘http://www.socialagent.me/wp-content/uploads/2014/07/avatarDefault.png’;
}
add_filter( ‘bp_core_mysteryman_src’, ‘myavatar_add_default_avatar’ );nice greetings Sandra
June 20, 2016 at 18:40 #126084RaduModeratorYou can check if is groups component like that
COPY CODEfunction myavatar_add_default_avatar( $url ){ if ( bp_is_group_component() ) { return 'http://www.socialagent.me/wp-content/uploads/2014/07/avatarDefault.png'; add_filter( 'bp_core_mysteryman_src', 'myavatar_add_default_avatar' ); } }
Cheers
R.Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionJune 21, 2016 at 09:52 #126160CarlenYParticipantIs it possible to hide members from the directory if they don’t have an avatar yet?
June 21, 2016 at 14:31 #126178lorndalParticipantHi Radu,
this script is not working as it should.function myavatar_add_default_avatar( $url ){
if ( bp_is_group_component() ) {
return ‘https://www.mywebsite/community/wp-content/uploads/2016/06/default-avatar.jpg’;
add_filter( ‘bp_core_mysteryman_src’, ‘myavatar_add_default_avatar’ );
}}a total different avatar is loading:
from: https://www.gravatar.com/avatar/9b570a6d2ea1bbd27909025157dc7a6b?s=50&r=g&d=mmand the script makes no differences between group and member avatars.
What do I have to improve?
thanks nice greetings SandraJune 21, 2016 at 18:27 #126212RaduModeratorHi guys,
@CarlenyFollow this : https://buddypress.org/support/topic/show-only-members-with-avatars-on-member-loop/ and this https://buddypress.org/support/topic/hide-profiles-without-avatars/
———————
@lorndal Follow this tutorial https://premium.wpmudev.org/blog/how-to-add-a-custom-default-avatar-for-buddypress-members-and-groups/ and remove the code from before.A plugin for group avatars : https://eu.wordpress.org/plugins/bp-default-group-avatar/
Cheers
R.Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution -
AuthorPosts
The forum ‘General questions’ is closed to new topics and replies.