This topic has 7 replies, 2 voices, and was last updated 7 years by Kieran_SQ.

  • Author
  • #169024
     allana
    Participant

    Hi,

    No (default) profile pic is showing before a user uploads their own. So at the moment if i create a profile i am just getting a quesiton mark where the profile pic is (see attachment)

    Is there a way of having a default image show up for users who have not uploaded their own?

    Thanks!

    Attachments:
    You must be logged in to view attached files.
    #169036
     Kieran_SQ
    Moderator

    Hi @allana,

    That’s very strange indeed as that image comes from WordPress and you’re getting a 404 error for it. Are you by chance using any plugin or custom code to do with Gravatars or Speed up site by removing X piece of code?

    If you’d like to be able to set your own please use the below code in your functions.php file

    COPY CODE
    define ( 'BP_AVATAR_DEFAULT', $img_url );
    define ( 'BP_AVATAR_DEFAULT_THUMB', $img_url );

    An example with a URL is

    COPY CODE
    define ( 'BP_AVATAR_DEFAULT', 'http://example.com/default-avatar.jpg' );
    define ( 'BP_AVATAR_DEFAULT_THUMB', 'http://example.com/default-avatar-thumb.jpg' );

    You can read more on this here: https://codex.buddypress.org/themes/guides/customizing-buddypress-avatars/

    Thanks,

    Kieran.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Custom development requests can be sent to dev@seventhqueen.com, one of the development team will be happy to discuss your needs.

    #169048
     allana
    Participant

    Hi,
    Do you mean: make these changes in the main funtions.php …or the child theme?

    I tried pasting the code into the child theme and nothing changed :/

    #169051
     Kieran_SQ
    Moderator

    Hi,

    My apologies I should have said as much. These changes should be added to your child theme’s functions.php

    Is this where you added the code?

    Kieran.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Custom development requests can be sent to dev@seventhqueen.com, one of the development team will be happy to discuss your needs.

    #169053
     allana
    Participant

    Yeah thats where I added it. Oddly enough, the BP avatiar default image has come back (after uninstalling a plugin) but i still cant set a custom default image.

    #169054
     Kieran_SQ
    Moderator

    Hi,

    By chance was the plugin Jetpack?

    Could you try the code in bp-custom.php and see if that works? You can see how to create this file here https://codex.buddypress.org/themes/bp-custom-php/

    Kieran.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Custom development requests can be sent to dev@seventhqueen.com, one of the development team will be happy to discuss your needs.

    #169118
     allana
    Participant

    Cool, i created the bp-custom.php files no problem, but when i entered and saved the code below, the text of the code itself appeared across the top of the page. Did i need to put some kind of tags either side of the code? Sorry, im new to this 🙂

    define ( ‘BP_AVATAR_DEFAULT’, ‘http://example.com/default-avatar.jpg’ );
    define ( ‘BP_AVATAR_DEFAULT_THUMB’, ‘http://example.com/default-avatar-thumb.jpg’ );

    #169153
     Kieran_SQ
    Moderator

    Hi,

    Sorry for the delay in getting back to you. Sorry to hear it isn’t working for you, please remove the snippet I sent you from functions.php and bp-custom.php and try the following in your child theme’s functions.php

    COPY CODE
    //Custom avatar for no avatar user
    function myavatar_add_default_avatar( $url ){
    return 'http://www.mydomain.com/wp-content/uploads/2014/07/avatarDefault.png';
    }
    add_filter( 'bp_core_mysteryman_src', 'myavatar_add_default_avatar' );

    Please replace the path to the image with your own. If that doesn’t work please follow this post on WPMUdev https://premium.wpmudev.org/blog/how-to-add-a-custom-default-avatar-for-buddypress-members-and-groups/

    Thanks,

    Kieran

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Custom development requests can be sent to dev@seventhqueen.com, one of the development team will be happy to discuss your needs.

Viewing 8 posts - 1 through 8 (of 8 total)

The forum ‘Bugs & Issues’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?