WordPress.org

Ready to get started?Download WordPress

Forums

User photo : unable to display default image (3 posts)

  1. Nessdufrat
    Member
    Posted 6 years ago #

    Hi ! I have a problem with the User Photo plugin, and I'm sure it must be quite silly, but I can't figure it out.
    I want to specify a defaut image if no image is specified in the user's profile.
    I'm trying the synthax provided in the plugin explanation :
    userphoto_the_author_photo($before, $after, $attributes, $default_src)

    userphoto_the_author_photo('','','','http://www.domain.com/dummyimage.jpg');

    I can't get anything to appear. What am I doing wrong ? The rest of the plugin works perfectly for me. (of course, I'm trying it with an url pointing to a real image)

  2. Nessdufrat
    Member
    Posted 6 years ago #

    Oh, drop it, I found out by myself. Maybe it will be useful for other people. Actually, the default_src is not a "hard-coded url" (sorry for my english), but is a relative path to the uploaded/user-photo directory. So let's say you have a picture named "other.jpg" in this directory, your default_src would be 'other.jpg'
    BTW, apparently, a user needs to be registered to have a default image. It doesn't work with simple visitors who are not registered in the users database.
    (correct me if I'm wrong)

    What I was trying to do was display a default image for the visitors. Any way to do that ?

    Thanks for all suggestions !

  3. 314media
    Member
    Posted 5 years ago #

    I'm interested in this as well. Showing a default image for any guests that comment and are not logged in.

    I've got the comment_author_thumb in the comments.php and wondered if there was an if then statement written to display a default 80x80 image if the user is not logged in ...

Topic Closed

This topic has been closed to new replies.

About this Topic