Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function dd_xprofile_cover_image( $settings = array() ) {
- $settings['default_cover'] = 'http://...';
- $settings['width'] = 1920;
- $settings['height'] = 700;
- return $settings;
- }
- add_filter( 'bp_before_xprofile_cover_image_settings_parse_args', 'dd_xprofile_cover_image', 10, 1 );
- function dd_groups_cover_image( $settings = array() ) {
- $settings['default_cover'] = 'http://....jpg';
- $settings['width'] = 1920;
- $settings['height'] = 700;
- return $settings;
- }
- add_filter( 'bp_before_groups_cover_image_settings_parse_args', 'dd_groups_cover_image', 10, 1 );
- function bp_cover_img_path() {
- // Is the current page a user page?
- if ( bp_is_user() ) {
- $user_id = bp_displayed_user_id();
- $attachment = bp_attachments_get_attachment( 'url', array( 'item_id' => $user_id ) );
- $image_path = $attachment;
- // output only if an attachment exist
- if( !empty( $attachment ) ) { ?>
- <style type="text/css">
- .header-title.header-title-profile { background-image: url( '<?php echo $image_path; ?>' ); }
- </style>
- <?php } else { ?>
- <style type="text/css">
- .transparent-cover { display:none; }
- </style>
- <?php }
- }
- }
- add_action( 'bp_profile_cover_path', 'bp_cover_img_path' );
- function bp_cover_group_img_path() {
- // Is the current page a user page?
- if ( bp_is_group() ) {
- $group_id = bp_get_group_id();
- $attachment = bp_attachments_get_attachment( 'url', array(
- 'object_dir' => 'groups',
- 'item_id' => $group_id,
- ) );
- $image_path = $attachment;
- // output only if an attachment exist
- if( !empty( $attachment ) ) { ?>
- <style type="text/css">
- .header-title.header-title-group { background-image: url( '<?php echo $image_path; ?>' ); margin-top: -133px; }
- </style>
- <?php } else { ?>
- <style type="text/css">
- .transparent-cover { display:none; }
- </style>
- <?php }
- }
- }
- add_action( 'bp_group_cover_path', 'bp_cover_group_img_path' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement