Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have a BuddyPress 1.6.x installation on WordPress 3.4.2.

User avatars are not displaying in the following situations.

On pages like: www.domain.com/members/USERNAME/profile/edit/group/1/

Here is the outputted code for the bigger user avatar, when they're editing their profile.

<img src="http://www.gravatar.com/avatar/830569c53139a7983673c2a4b331abb4?d=http://www.domain.com/wp-content/themes/bp-dusk/images/c2c_avatar_2.jpg&amp;s=150&amp;r=G" alt="Profile picture of USERNAME" class="avatar user-305-avatar" width="150" height="150">

Or on the sidebar, where it has a user's avatar, along with their username and a logout button.

Here is the outputted code for the sidebar avatar.

<img src="http://www.gravatar.com/avatar/830569c53139a7983673c2a4b331abb4?d=http://www.domain.com/wp-content/themes/bp-dusk/images/c2c_avatar_2.jpg&amp;s=40&amp;r=G" alt="Profile picture of USERNAME" class="avatar user-305-avatar" width="40" height="40">

However, we are using some code to alter the mystery man avatar (If no avatar exists, it defaults to this avatar)

Here is our mystery man avatar filtration code.

function myavatar_add_default_avatar($url){
    return get_stylesheet_directory_uri() .'/images/c2c_avatar_2.jpg';
}
add_filter('bp_core_mysteryman_src', 'myavatar_add_default_avatar');

If I try copy/pasting the generated Image SRC into my browser, it returns "Sorry, the parameters you provided were not valid"

If I copy just the relative domain URL from the outputted image SRC (Example: www.domain.com/wp-content/themes/bp-dusk/images/c2c_avatar_2.jpg) It loads the image correctly in my browser.

I'm thinking this issue has something to do with BuddyPress and the Gravatar service.

If there is no user avatar set, shouldn't it be displaying the mystery man avatar, and not looking on the Gravatar service?

What are some of the actions or filters I should be checking? Can I override a hook so that I can force this to work?

share|improve this question
    
Can't quite come up with an explanation on why this happened, but I backed up my database. Reinstalled BuddyPress, and restored the database. Problem solved. –  Michael Ecklund Oct 21 '13 at 14:29
add comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.