Find Answers and Get Support › Forums › Gwangi – PRO Multi-Purpose Membership, Social Network & BuddyPress Community Theme › Website Setup › Pages › Remove background cover image default on BP profiles
- This topic has 5 replies, 2 voices, and was last updated 5 years, 6 months ago by Themosaurus.
-
AuthorPosts
-
@themosaurus
- 1 Topics
- 1675 Posts
Hi @abourne,
Yes, you can change the default cover image for the user profile. The following PHP code snippet should do the trick:
/** * Change the settings for the BuddyPress cover image. * * @param array $settings The array of default settings for the BuddyPress cover image. * * @return array The array of settings for the BuddyPress cover image. */ function gwangi_custom_change_xprofile_cover_image_settings( $settings = array() ) { $settings['default_cover'] = 'https://source.unsplash.com/3-mj98Da3vA/1850x550'; return $settings; } add_filter( 'bp_before_xprofile_cover_image_settings_parse_args', 'gwangi_custom_change_xprofile_cover_image_settings', 20, 1 );
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:
Finally, please don’t forget to change the example URL between single quotation marks for the URL to your new default cover image. The ideal ratio for this picture is 1850x550px.
We hope this will help. ?
Best regards,
October 16, 2018 at 21:56 #2933alexParticipant@abourne- 81 Topics
- 259 Posts
Thanks. I added this:
function gwangi_custom_change_xprofile_cover_image_settings( $settings = array() ) { $settings['default_cover'] = 'https://www.gymn.com.au/wp-content/uploads/2018/10/male-athlete-powerlifter-PGXFJJD-3.jpg/1850x550'; return $settings; } add_filter( 'bp_before_xprofile_cover_image_settings_parse_args', 'gwangi_custom_change_xprofile_cover_image_settings', 20, 1 );
For all existing and all new profile registrations, the cover photo appears as attached. It is not the provided url default image.
Please help figure out the problem.
October 17, 2018 at 00:41 #2939@themosaurus- 1 Topics
- 1675 Posts
Hi @abourne,
Your image url seems to be wrong. You entered this:
https://www.gymn.com.au/wp-content/uploads/2018/10/male-athlete-powerlifter-PGXFJJD-3.jpg/1850×550And this one seems to work:
https://www.gymn.com.au/wp-content/uploads/2018/10/male-athlete-powerlifter-PGXFJJD-3-1850×550.jpgIn addition, I notice that your image is very high. I advise you to reduce its size (2000px maximum) and transfer to the online application “Tinypng” (https://tinypng.com/). This will considerably reduce his weight.
Hope this will help you :).
Regards,
October 17, 2018 at 09:56 #2947 -
AuthorPosts
The topic ‘Remove background cover image default on BP profiles’ is closed to new replies.