Skip to:
Content
Pages
Categories
Search
Top
Bottom

need help for cover photo

  • Profile photo of Iuda
    Iuda
    Participant

    @iuda

    Hy.

    How to set a default cover photo for all users in my comunity site ? I don’t whant to alow individual upload for cover photo

    Thank you.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Profile photo of danbp
    danbp
    Moderator

    @danbp

    Profile photo of Iuda
    Iuda
    Participant

    @iuda

    Hy.
    i put this function

    function bp_custom_filter_cover_image() {
        return 'http://failtrafic.ro/wp-content/uploads/2017/01/iarna.jpg';
    }
    add_filter( 'bp_attachments_pre_get_attachment', 'bp_custom_filter_cover_image' );

    in themes functions.php but not work.

    Any sugestion ?

    Profile photo of danbp
    danbp
    Moderator

    @danbp

    why don’t you use the mentionned plugin ?

    Profile photo of Iuda
    Iuda
    Participant

    @iuda

    Problem solved. Thanks to Brajesh from BuddyDev

    1. Disable the cover upload by users
    2. Setup a default cover

    You can put the following code in your bp-custom.php to achieve that.

    Please make sure to change the default_cover image url

    /**
     * Disable the Change Cover from uSers profile
     */
    function buddydev_disable_cover_upload() {
    bp_core_remove_subnav_item('profile', 'change-cover-image');
    }
    add_action( 'bp_xprofile_setup_nav', 'buddydev_disable_cover_upload' );
    
    //set default cover
    
    function buddydev_set_default_profile_cover( $settings = array() ) {
    $settings['default_cover'] = 'http://yoursite.com/yourimage.jpg';
    return $settings;
    }
    add_filter( 'bp_before_xprofile_cover_image_settings_parse_args', 'buddydev_set_default_profile_cover' );
Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Skip to toolbar