Forum Replies Created
-
AuthorPosts
-
mhuntdesignMember
THANK YOU!! That worked!
mhuntdesignMemberOk so I made some progress with this one. I had to use a different piece of code.
I had to do some research initially to figure out how to display user meta data. Since I new what function to use for that, I was actually only a step away.
I looked on the actual form html code to see the name attribute of an existing custom field then I searched for what was set for the avatar.. which was user_avatar.
Here is the code if it shows through properly:
But first the steps:
1) Get the author id.
2) Get the value of the user_avatar field in the database
3) Since the value starts at a subdirectory of uploads… output that path
as part of the src attribute value.
That does it.
$curauth = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));$author_id = $curauth -> ID;
$user_avatar = get_usermeta($author_id,'user_avatar');
<img src="/wp-content/uploads/" width="220" height="220" />The only thing that is not resolved at the point is that the avatars do not update in the comments section for anyone who does not currently use a gravatar icon with their email.
mhuntdesignMemberI did a few more tests. It works for people that already have a gravatar. If the user does not have a gravatar, then it does not replace the existing. The new image does show on the backend, but not on the front using the get_avatar function.
mhuntdesignMemberThe latest rc3 from may 4th. I can’t post the url to the dev site publicly. But Basically what I am trying to do is use the avatar field to update the avatar. So it would have to replace the gravatar I suppose.. much like what buddypress does. So what you have here for the account photo: http://user-meta.com/account/ and on the comments on this site for instance, I would assume the expectation of the avatar field is to replace the avatar. That does work but I only see the avatar updated when I go to the WP backend under Users. Is anything anything special to get it ti work? Like I said the normal get_avatar’ function did not work for me. it simply shows the old avatar.
Thanks for taking a look!
-
AuthorPosts