Find Answers and Get Support › Forums › Gwangi – PRO Multi-Purpose Membership, Social Network & BuddyPress Community Theme › Compatible Plugins › BuddyPress › Set default BuddyPress Cover Images for groups
- This topic has 10 replies, 2 voices, and was last updated 6 years, 4 months ago by
Themosaurus.
-
AuthorPosts
-
alexParticipant@abourne
- 81 Topics
- 259 Posts
I used the BP codex, but did not apply:
function your_theme_xprofile_cover_image( $settings = array() ) { $settings['default_cover'] = 'https://www.gymr.com.au/wp-content/uploads/2018/11/41a4fa77-d87c-4e32-bcdc-14badfad6a33.jpg'; return $settings; } add_filter( 'bp_before_groups_cover_image_settings_parse_args', 'your_theme_xprofile_cover_image', 10, 1 );
Then used this, also failed:
// Default group cover image function custom_default_group_cover_image( $settings = array() ) { $settings['default_cover'] = 'https://www.gymr.com.au/wp-content/uploads/2018/11/41a4fa77-d87c-4e32-bcdc-14badfad6a33.jpg'; // path to your image return $settings; } add_filter( 'bp_before_groups_cover_image_settings_parse_args', 'custom_default_group_cover_image', 10, 1 );
Please suggest if something should be otherwise.
November 29, 2018 at 15:01 #3932alexParticipant@abourne- 81 Topics
- 259 Posts
Why is this not working? I set priority from 10, to 20 and then 30 – none worked…
function bb_cover_image( $settings = array() ) { $settings['width'] = 949; $settings['height'] = 712; return $settings; } add_filter( 'bp_before_groups_cover_image_settings_parse_args', 'bb_cover_image', 10, 1 );
My default image are these exact dimensions.
When deactivating code or activating it – no changes are made to image size on groups – hence not working properly.
Thanks again.
December 1, 2018 at 07:27 #3958@themosaurus- 1 Topics
- 1675 Posts
December 3, 2018 at 15:27 #3994@themosaurus- 1 Topics
- 1675 Posts
Hi @abourne,
Here is a CSS snippet that will display your cover image in full:
@media (min-width: 1200px) { #buddypress div#item-header #header-cover-image { height: 840px !important; background-position: center center; } #buddypress div#item-header #profile-header { height: 600px !important; } }
Regards
December 5, 2018 at 10:30 #4065alexParticipant@abourne- 81 Topics
- 259 Posts
Applied this. It makes the dimensions of every cover photo placement container from any group push way lower down screen – hence cutting off cover pic and group info which makes the user need to scroll a little.
The intent is not to change the layout of cover image size on all groups, rather just make this particular image as a default fit into the
exact dimensions of the existing cover image placement container.Should it be best to just resize this image? I tried forever in paint – random dimensions to get it to fit. Failed.
[‘width’] = 949;
[‘height’] = 712;
Is the original size of imageWhat should this image be resized too in order to fit within the existing position/placement/container of cover images.
Or should the above CSS be altered?
Regards
December 6, 2018 at 02:26 #4095@themosaurus- 1 Topics
- 1675 Posts
Hi @abourne,
To get your default image to fit, you would indeed need to resize it. Your image needs to have the same (or similar) ratio as the cover container. For instance, the default cover size on our demo is 1800 x 500, so you should try to resize your image to fit these dimensions or have the same or similar ratio.
I hope this information will help.
Regards
December 6, 2018 at 11:58 #4099@themosaurus- 1 Topics
- 1675 Posts
You’re welcome alex. ?
Best regards,
December 7, 2018 at 11:16 #4123 -
AuthorPosts
The topic ‘Set default BuddyPress Cover Images for groups’ is closed to new replies.