Display avatar of user profile when logged in

I am trying to display user’s avatar/profile image when logged in, but when I use this: <?php global $current_user; get_currentuserinfo(); echo get_avatar( $current_user->ID, 64 ); ?> it displays the default_avatar_male.jpg, but I don’t want anything to be displayed unless logged in. Thanks for all help. 2 Answers 2 Hey pass the current user email id … Read more

Replace comment avatars and links at the same time

I am trying to replace WordPress comment author data: 1) Avatar (uploaded image instead of Gravatar) 2) Author link (link to author page as only members can comment) I have found a great solution to this from this question, and have implemented the following code: if ( ! function_exists( ‘t5_comment_uri_to_author_archive’ ) ) { add_filter( ‘get_comment_author_url’, … Read more

How to remove unused avatar uploads in buddypress [closed]

Closed. This question is off-topic. It is not currently accepting answers. Your question should be specific to WordPress. Generic PHP/JS/HTML/CSS questions might be better asked at Stack Overflow or another appropriate site of the Stack Exchange network. Third party plugins and themes are off topic. Closed 7 years ago. Improve this question Im seeing in … Read more

Changing default Buddypress avatar affects all site avatars (because gravatar)

I’ve been looking for a way to change the default Buddypress avatar for members, and have managed it, partially just using the simple Buddypress codex info here. BUT The codex info doesn’t quite do the trick. It seems that Gravatar overrides it, so the only way the codex code works is if I first disable … Read more

Displaying Logged-In User Name and avatar in WordPress Menu

I want show the avatar user and username with this code. add_filter( ‘wp_nav_menu_objects’, ‘my_dynamic_menu_items’ ); function my_dynamic_menu_items( $menu_items ) { foreach ( $menu_items as $menu_item ) { if ( strpos($menu_item->title, ‘#profile_name#’) !== false) { $menu_item->title = str_replace(“#profile_name#”, wp_get_current_user()->user_login, $menu_item->title); } } return $menu_items; } The username is work but i don’t known add avatar. Can … Read more