comment_author_user_ID
-
Alright, here’s my dilemma:
My blog is designed around a specific community and therefore all users must be logged in to comment. What I want to do is add pictures (not using favatars or gravatars or anything that requires my computer-illiterate users to do anything other than upload a file) to go alongside the user’s comment. Example: when Bob posts I want to see Bob’s face next to the comment.
I have all the programming in place to be able to handle pictures there, all I need is a way to distinguish which user is commenting, and add the appropriate picture file.
My first idea was use “comment_author()” in the filename, making it
<?php comment_author() ?>.jpg. But comment_author() can change if the user changes his/her display name, thus creating a link to a picture that doesn’t exist (BobSmith.jpg instead of Bob.jpg). Also, WordPress allows spaces in names (Bob Smith) which is not allowed in filenames.So I was thinking that there’s gotta be a hack to add an extra tag (like comment_author_user_ID) that will remain constant regardless of what an individual user changes in his/her user settings. I just don’t know how to pull this information out, as WordPress is designed to be able to take comments from people with no user ID.
Anyone have any ideas? I’m open to anything to get these pictures to work. Any kind of hacking, coding or plugining is fine, as long as I can get this to work.
Thanks,
-Steve
The topic ‘comment_author_user_ID’ is closed to new replies.