You can use get_avatar
. The following example prints an avatar in 96 px, assuming that you have the user id stored in $user_id
, and prints a fallback user.png
if no such user or image could be found.
echo get_avatar($user_id, 96, get_stylesheet_directory_uri() . '/images/user.png');
Related Posts:
- Custom Gravatar not working
- I want to display author gravatar on posts. How to do this?
- How to change Gravatar size when using comments_template
- Gravatar not showing when calling users details
- Which core file is responsible for gravatars?
- Gravatar Size Via Theme Functions?
- Gravatar always shows default image
- how to separate gravatar picture and new user picture
- How to change the gravatar image from front end?
- Building Gravatar Code
- How can I changing or replace user’s avatar without plugins?
- Removing Gravatar.com support for WordPress and Simple Local Avatars
- Replace Gravatar with uploaded images?
- Custom user avatar in the WordPress users listing
- If Else Gravatar Author Picture
- Upload gravatar in WP profile?
- How to check if gravatar of user is the default’s one?
- How do I add a custom HTML attribute to get_avatar?
- Setting different width and height for gravatar
- Use local image for default avatar
- Filtering the default avatar list
- Wrong gravatar showing up?
- Add gravatar to author list
- Alternative default avatar generator?
- How to get gravatar url alone
- Replace default avatar
- Listing all users by their avatars in wordpress
- How to replace any occurence of Gravatars with a local placeholder image?
- How to output nothing instead of default avatar?
- get the avatar url instead of an html img tag when using get_avatar?
- get_user_meta Short Profile Section
- Changing default Buddypress avatar affects all site avatars (because gravatar)
- Replace Gravatar with img URL for avatars
- How to Add a Random Custom Gravatar in the WordPress Comments?
- Get users only if Gravatar is specified
- Assign a random avatar to every user?
- Replace comment avatars and links at the same time
- get_avatar() default image not working as of wp 3.5 [closed]
- Cannot get local avatars to show [closed]
- Use Gravatar as fallback image if no local image is not found
- Can I hook into get_avatar to supply a hash instead of an email?
- How to change avatar of the comment author using comment ID?
- get_avatar won’t show uploaded avatar, only default gravatar
- Force users to display default Gravatars
- Snippet for own (gr)avatars
- WordPress Gravatar filter is removing my custom attributes
- In this snippet how do I force the function to use gravatar rated G and fill in the alt for get_avatar()?
- Custom avatar image link added to the profile page
- Customize Avatar using user meta
- custom default avatar showing broken link
- Disable Gravatars in WordPress
- Remove hovercard for only certian gravatars
- Which Function Displays The Post Authors Gravatar
- Change the “Default Avatar” admin option via functions.php
- How to prevent a specific users’s profile photo (gravatar) from showing on the frontend to other users?
- How do I get a post author’s image/avatar via RSS from another blog?
- Gravatar – Default IMG
- Custom Field Repeating When Using foreach
- Gravatar image url is wrong?
- How to add custom class to get_avatar()
- Avatar picture does not display when using get_avatar
- Working with Gravatars within a localhost development area
- Adding avatars/gravatar to a WordPress blog
- How to get all users that uploaded avatars or have gravatars? [closed]
- Simple Local Avatar Plugin
- Default Gravatar not showing for pings
- Avatar picture is broken
- Gender based user avatar
- get_avatar filter is not working as per requirement
- i1.wp.com url problem (Jetpack not installed)
- How to get User Avatar Image with link to Author and User name in Html Title tag?
- WordPress User Gravatar images not displaying. Loading default instead
- GravatarLocalCache Plugin Broken in WordPress 4.2
- WordPress shows admin’s avatar after editing a comment
- Show custom default avatar instead of gravatar
- Increase Comment Author Gravatar Size On WordPress Default Comment Function
- Show author name not the author ID
- Adding Gravatar to rss feed
- Broken Gravatar images in comments
- How to load locally saved author photos based on author ID
- How to add avatar to authors list?
- How do I add nopin=”nopin” to the default avatar?
- Convert User’s Avatar/Gravatar to a jpg or png on the Fly
- Adding custom avatar field to comments