I'm using this custom function to get the default avatar from my server instead of gravatar: if(!function_exists('custom_avatar')){ function custom_avatar($avatar_defaults){ $new_default_icon = 'http://localhost/gv/wp-content/images/mystery-man.png'; $avatar_defaults[$new_default_icon] = 'Custom Avatar'; return $avatar_defaults; } add_filter('avatar_defaults','custom_avatar'); } but the custom avatar is not showing up, when I view source code then the src of the image look like this: http://0.gravatar.com/avatar/a432e8915b383edd8d25c2a4fd5a6995?s=32&d=http%3A%2F%2Flocalhost%2Fgv%2Fwp-content%2Fimages%2Fmystery-man.png%3Fs%3D32&r=G&forcedefault=1 Why does my image src relative to gravatar here? How can I fix this problem?
I'm running wp multisite and using ACF custom field (user edit) for my local avatar, in my functions.php i added : add_action('get_avatar', 'tsm_acf_profile_avatar', 10, 3); function tsm_acf_profile_avatar( $avatar, $id_or_email, $size, $default, $alt ) { $user = ''; // Get user by id or email if ( is_numeric( $id_or_email ) ) { $id = (int) $id_or_email; $user = get_user_by( 'id' , $id ); } elseif ( is_object( $id_or_email ) ) { if ( ! empty( $id_or_email->user_id ) ) { $id = …
I have the exact same question as the gentleman who started this thread a year ago: https://wordpress.org/support/topic/possible-to-give-users-a-gallery-of-avatars-to-choose-from/ — that is, “I’m looking for a way to give users a limited number of avatars to choose from. More specifically, – I want to disable Gravatar – I do NOT want them to be able to upload an avatar – I do NOT want to have one single default avatar that everyone gets with no choice – I want to provide them …
I am using a plugin that allows users to upload profile graphics in place of avatars. The plugin is "User Avatar". I am displaying user profile graphics with this code: echo get_avatar( get_the_author_meta('user_email'), $size = '60') It works fine except I would like it to function so that, if a user does not have a user profile graphic, it defaults to display nothing. If I use the avatar Discussions settings to display "Blank" when there is no user avatar I …
Most of the commenters at my WordPress blog do not have a Gravatar account. Hence the comment section is almost always filled with the same old mystery man avatars. I am looking for custom gravatar generators for commenters without their own avatar. So far I have only found Identicons, MonsterID’s, and Wavatars. I find some of the avatars generated by these engines to be these ugly, scary and OTT. Also these do not blend with the blog theme and stick …
I am looking for a solution to output nothing instead the default avatar when a user does not have any avatar. I am currently using this line. I looked at the function and the only thing I got so far is to use blank as default avatar but its still occupies space and I do not want that. echo get_avatar( get_the_author_meta( 'ID' ), 70, 'blank', __( 'avatar', 'bla' ) ); Sidenote: Even that blank avatar gets pulled from Gravatar, I …
I want to show avatar from the post author. I use Ultimate Members and want to show the avatars that are defined via UM. <?php global $post; $url = get_avatar_url( $post, array( 'size' => 48 )); $img = '<img alt="" src="'. $url .'">'; echo $img; ?> But this code shows the gravatars or default avatar. How can I get the avatars from Ultimate Member?
I need for a specific plugin to override the wordpress function get_avatar() to bind the profile image to an other image with some condition. How can I do this ? Is there a specific hook or filter to do this ?
I noticed that if someone clicks on my Pinterest share button on a blog post, several unrelated images show up. I was able to use nopin="nopin" per Pinterest's documentation on most of these images to clean most of it up. However, I have a custom avatar set in my functions.php... //* Add new default gravatar to Settings » Discussion page */ add_filter( 'avatar_defaults', 'wpb_new_gravatar' ); function wpb_new_gravatar ($avatar_defaults) { $myavatar = 'https://www.fakedomain.com/wp-content/uploads/2017/03/PiggyBank.jpg'; $avatar_defaults[$myavatar] = "Default Gravatar"; return $avatar_defaults; } If …
I need to get the post author profile picture link. I know I can use get_avatar(); but it displays whole image markup <img src="http://.../img.png" class="avatar img-responsive" alt="image"> But need only the src of the author profile pic. How can I got that ? Maybe we can use some php or js to take out the only src value from the total output. My second question is, how can I add that image as post_thumbnail if no thumbnail exist for that …
I am attempting to add an avatar image to the top nav menu. I am currently using this function, which takes a custom link and replaces it with the currently logged in user's name. That part of the function works excellent. My attempts to modify the function haven't gotten me across the finish line yet. Yes, there is a question on here that is kind of similiar, Inserting PHP before a menu element, while using the inbuilt menu function wp_nav_menu(), …
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.
I got a requirement to update the WordPress's admin panel, where I need to display the current user's avatar on the top of admin's main menu(see the screenshot).
How do I get the authors avatar? Buddypress plugin or any plugin. I have found this inside my PHP code: "<i class="fa fa-user"></i><span>'.get_the_author().'</span></div>';" It shows a small image before the author's name, I wanted to change the fa fa-user into author's avatar or buddypress avatar. What will be the script to do that?
I have a function that creates a bio-line at the top of every post. One part gets the avatar of that user, that he uploaded in WordPress (I use a plugin so people don't need to use Gravatar for this). function mm_author_byline() { if (is_single() AND (get_post_type() == 'post' OR get_post_type() == 'theme_product_review')) { ?> <div class="mm-byline-image"> <?= get_avatar(get_the_author_meta('ID')) ?> </div> <?php } } The problem now is, that this image is neither cropped, nor is it sized down. It …
I have used this code to display author image. It was working in Local By FlyWheel but isn't working on a live site. It's not working means that it is not producing any HTML. <?php $post_id = get_the_ID(); $author_ID = get_post_field( 'post_author', $post_id ); echo get_avatar( $author_ID, 32); ?>
I am using WP User Avatar Plugin instead of gravatar for user profile. But gravatar is not working so well. I want to add image upload field on woocommerce account page. How can I do that? Please help. Thanks
There's gotta be a way. I have tried a bunch of different multisite sync plugins and they sync users and roles just fine (even paid for plugins to do so)....but avatars don't sync. My registration form handles the image upload just fine -- and assigns it to the user (but only on the one site the registration came from) -- and shows blank/no image/avatar on the rest. I've nearly been pulling my hair out on this and while I don't …
I think that Im very close to achieve my goal.. I have this function on my themes but I need a help to find the right way to call simple local avatar function so it will show the local avatar image from simple local avatar pugin instead wordpress gravatar? $first_img = get_avatar( $post->post_author ); Is there anyone can help? function get_post_image() { global $post, $posts; $first_img = ''; ob_start(); ob_end_clean(); $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches); $first_img = $matches [1] [0]; …
Currently I'm using Simple Local Avatars on several of my blogs allowing people to upload their own custom avatar. As far as I know Simple Local Avatars uses get_avatar to check whether a custom avatar is selected, if not defaults to Gravatar.com. Would it be possible to disable the Gravatar.com bit somehow, disabling Gravatar.com completely and returning just some local hosted image if no custom avatar is selected? I hope it would be OK to post this here, but this …