Find Answers and Get Support › Forums › Gwangi – PRO Multi-Purpose Membership, Social Network & BuddyPress Community Theme › Compatible Plugins › BuddyPress › Setup profil cover image
- This topic has 6 replies, 2 voices, and was last updated 6 years, 2 months ago by
Themosaurus.
-
AuthorPosts
-
@themosaurus
- 1 Topics
- 1675 Posts
Hi @joss,
Here is a PHP code snippet that should allow you to change the default cover image on member profiles:
add_filter( 'bp_before_xprofile_cover_image_settings_parse_args', 'gwangi_change_default_member_cover', 20, 1 ); if ( !function_exists('gwangi_change_default_member_cover') ) { function gwangi_change_default_member_cover( $settings = array() ) { $settings['default_cover'] = 'your_image_url'; return $settings; } }
Don’t forget to change ‘your_image_url’ by your own image url in the snippet.
If you need to find out how to add a PHP code snippet to your site, we recommend that you visit this article of our documentation:
Best regards,
January 22, 2019 at 12:46 #4699@themosaurus- 1 Topics
- 1675 Posts
Hi @joss,
I did a quick check on your website and noticed that the “Cover Image Uploads” option in BuddyPress (in Settings > BuddyPress > Options) was disabled, which is why the cover image was not showing (the option is called “En tête de profil” in french). I enabled that option, if you go on a profile page you can see that your cover image is now showing correctly.
It is possible to assign a different cover image per member type by modifying the snippet that I previously gave you. Here’s a starting point:
add_filter( 'bp_before_xprofile_cover_image_settings_parse_args', 'gwangi_change_default_member_cover', 20, 1 ); if ( !function_exists('gwangi_change_default_member_cover') ) { function gwangi_change_default_member_cover( $settings = array() ) { $user_id = bp_displayed_user_id(); $member_type = bp_get_member_type( $user_id ); $settings['default_cover'] = 'default_cover_image_url'; switch( $member_type ) { case 'teacher': $settings['default_cover'] = 'student_cover_image_url'; break; case 'student': $settings['default_cover'] = 'teacher_cover_image_url'; break; } return $settings; } }
In that snippet you would need to change ‘teacher’ and ‘student’ by your member types and put your own cover image urls (you can also add more types if needed).
If you’re not comfortable with editing PHP code however, please note that we unfortunately cannot help much more than this as that kind of custom development is out of the support we can provide.
But of course if you need some custom development work, you can always require the services from Envato Studio freelancers (https://studio.envato.com/explore/websites-programming). This web platform gives you access to developers who have already experience with theme customizations, and for very competitive prices.
Hope this helps you in your website setup.
Best regards,
January 23, 2019 at 11:47 #4710@themosaurus- 1 Topics
- 1675 Posts
Hi @joss,
No need for a PHP snippet for that, you can do so with a simple CSS snippet 🙂
.member-type-x.buddypress.bp-user:not(.activity-permalink) .entry-content > #buddypress:after { background-image: linear-gradient(15deg, #F26E93 50%, rgba(255,255,255,0) 100%); }
Don’t forget to change the “x” in “member-type-x” by your member type and the gradient color “#F26E93” by the color of your choice. Then duplicate this snippet for all your member types.
If you need to find out how to add custom CSS to your site, we recommend that you visit this article of our documentation:
Regards,
January 23, 2019 at 15:50 #4714 -
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 ‘Setup profil cover image’ is closed to new replies.