‘default’ Paramater for get_avatar() and get_avatar_url() not working.
-
Hey folks,
I am working on a customized Buddypress Blogs loop, and I want the blog avatar to return a different image if no Gravatar is found with the site admin email, than the default image returned normally.
In other words, I am trying to set up an alternative “Default” Gravatar that only applies to one specific section of my website.
To do this, I am trying to use either the get_avatar() or get_avatar_url() functions, and setting the custom url in the $default parameter as stated in the codex.
$avatar = '<img src="'.get_avatar_url($blogs_template->blog->admin_user_id, array( "size" => "250", "default" => $url, )).'" alt="Profile photo of site author">';
This is not working. Setting the default parameter to standard things like “blank”, “mystery” or “404” also do not work. I have been spending a lot of time troubleshooting this, and am starting to wonder if it’s a bug with the function itself.
Anyone have any ideas?
Thank you so much!
- The topic ‘‘default’ Paramater for get_avatar() and get_avatar_url() not working.’ is closed to new replies.