Tagged: profile cover image
Hi Buddy-Dev Team,
can you tell me, is there a possibility to set a profile image by default for every member. So that there is an image instead of the grey profile-header-image-background.
Thanks in advance
GiselaHello Gisela,
Please use the following code:
add_filter( 'bp_core_default_avatar_user', function ( $avatar_url, $params ) { $type = 'full' === $params['type'] ? 'full' : 'thumb'; if ( 'full' === $type ) { // Recommended 150x150 resolution. //$avatar_url = 'http://example.com/6944274-150x150.png'; } elseif ( 'thumb' === $type ) { // Recommended 50x50 resolution. $avatar_url = 'http://example.com/6944274-50x50.png'; } return $avatar_url; }, 10, 2 );
Please give it a try and let me know.
Regards
RaviHi Ravi,
Thanks a lot – but I need more help
Sorry – I assume my question was not exactly – The “profile-header-image-background” – I meant the “Cover-Image” How can I set a cover image by default for all members, if they don’t upload an own image.I have added the code, but where can I upload a default image for all members?
Maybe I did not upload the code in the right file. Where should I add the code?Thanks in advance
GiselaHello Gisela,
Sorry, I understood your requirement wrongly. Please use the following code:
add_filter( 'bp_before_members_cover_image_settings_parse_args', function ( $settings ) { // Use 1300x225 resolution. $settings['default_cover'] = 'http://example.com/65dd8d5628062-bp-cover-image.jpeg'; return $settings; }, 20 );
It may depend on your theme. Please give it a try and let me know if it works or not.
Regards
RaviHi Ravi,
thank you! it works perfect.
I have the theme AVADABest wishes
Gisela
You must be logged in to reply to this topic.