Check If User Has Local Avatar Profile Picture


enter image description here

I tried these code snippets to display custom post meta with an avatar set using Local Avatar if the profile picture has been added on the User Profile page but neither work.

if( get_avatar( get_the_author_meta( 'ID' ) ) == 0) {

And this :

if( get_avatar( get_current_user_id() ) ){

I only want the code to execute if the image has been added otherwise it executes the default function which doesn’t include an avatar but the check doesn’t work for some reason.

I’m not using Gravatar to add the image, but Local Avatars, however the user may use their Gravatar email address and NOT use local avatars to add their profile image

Dev 1 year 2022-02-03T12:59:48-05:00 0 Answers 0 views 0

Leave an answer