@julien760
13 years ago
Nobody else have try to do this ?
hello,
I try to do the same thing. I want to display a specific picture following the gender of the members.
I use add_filter and the picture of the profil is the good one but all others pictures from sidebar, for example, are the same…
Have you finally find a solution for this issue ?
Thanks in advance,
My test code : function bp_remove_gravatar ($image, $params, $item_id, $avatar_dir, $css_id, $html_width, $html_height, $avatar_folder_url, $avatar_folder_dir) { $default = get_stylesheet_directory_uri() .’/images/bp_default_avatar.gif’; if( $image && strpos( $image, “gravatar.com” ) ){ if ( bp_get_profile_field_data( ‘field=Gender’ ) == ‘Female’ ) { $default = get_stylesheet_directory_uri() .’/images/def_f_avatar.gif’; return ‘‘; } if ( bp_get_profile_field_data( ‘field=Gender’ ) == ‘Male’ ) { $default = get_stylesheet_directory_uri() .’/images/def_m_avatar.gif’; return ‘‘; } else { return $image; } } else { return $image; } } add_filter(‘bp_core_fetch_avatar’, ‘bp_remove_gravatar’, 1, 9 );
Thank you for your answer Xevo.
Ok but if I do that, I’ll need to do in all area where there is profile picture… even in widget on sidebar… in member list, etc… It is very long, no?
It is not possible to modify the bp_member_avatar function to include this test?
It’s works like this when a member upload it’s own picture, it is automatically display as avatar but I don’t know how it works.
Thanks