WordPress.org

Forums

How to change the default Mystery Man gravatar? (11 posts)

  1. mila108
    Member
    Posted 4 years ago #

    Hi,

    WordPress has a default gravatar for people on my blog that do not have their own gravatar - a "Mystery Man". Well, my site is for women. I was wondering whether I could simply replace that Mystery Man image with my own gravatar image - a Mystery Woman? Again, this is for people who do not have their own gravatar.

    I wanted to simply swap the image so that I do not need to deal with the code if could help it!.... But I can't find a location of that generic Mystery Man image (and I don't know the name of that mystery image file either). Can anyone help me with that?

    Thanks!

  2. elfin
    Moderator
    Posted 4 years ago #

    Settings > Discussion will allow you to change what is used.

    There are also a few plugins that might help you get what you want:
    http://wordpress.org/extend/plugins/add-new-default-avatar/
    http://wordpress.org/extend/plugins/add-new-default-avatar-emrikols-fork/

    Though I'd also suggest you contact Gravatar and see if you can persuade them to add it as an option.

  3. mila108
    Member
    Posted 4 years ago #

    Thank you, but I prefer not to add any more plugins and NOT use code. I simply want to replace WordPress's mystery man with my own.

    I looked into Settings > Discussion but didn't see where I could add a default gravatar... I only saw the radio buttons to select from what's already there.. And, I prefer not to use code. Can't I just swap the WP's default image since I'm not going to use it for this site?

    Thanks!

  4. cybertecnia
    Member
    Posted 4 years ago #

    I read this post and decided to see if I could change my gravatar as you need to. I am using a theme which has a custom-gravatar displayed where you find all the radios buttons you mentioned. What I did was to right click on the image to get the exact image location and replaced it with one that I made. I tried the same with the other images but, as expected, those images are generated from gravatar.com -what theme are you using?

  5. mila108
    Member
    Posted 4 years ago #

    cybertecnia - this is clever! I ended up using a plugin: http://trepmal.com/plugins/add-new-default-avatar/. It works very well. But I like your solution, so if my site will load too slow once I publish it, I will definitely give it a try! Thanks! (I am using Genesis/Lifestyle child theme.)

  6. mila108
    Member
    Posted 4 years ago #

    PS: It looks like my default avatar is loaded by gravatar. I followed the URL (very long and cryptic) and it doesn't look like I would be able to change the image since I don't have "write" permission wherever it is... But thanks for the thought!

  7. cybertecnia
    Member
    Posted 4 years ago #

    mila108 - thank you! I guess my solution was helped by the fact I am using CATALYST as my new theme. I am setting up several blogs using this theme and I am glad I can change the default mystery man gravatar just by updating the image as you were looking forward to do it. I was looking for a solution myself in the forum and saw your post, and by curiosity I checked the image file path of my mystery man gravatar and realized I could just update the image. Here's what I did with my gravatar for a new blog I am setting up - ignore the language, just see the graphic - I thought I could share :)

    http://comocrearunblog.net/hola-mundo-1

    I think the less plugins I install the better so I think my theme's functionality helped me. How do you like Genesis? Doesn't it have a feature to allow you to do this?

  8. alchymyth
    Forum Moderator
    Posted 4 years ago #

    this does it for me on my local test site; it adds a new option to the list of avatars, and, obviously the image is self made in the images folder of the theme:

    add this code to functions.php of the theme:

    add_filter( 'avatar_defaults', 'newgravatar' );
    function newgravatar ($avatar_defaults) {
        $myavatar = get_bloginfo('template_directory') . '/images/own-gravatar.jpg';
        $avatar_defaults[$myavatar] = "Own";
        return $avatar_defaults;
    }
  9. LannaW
    Member
    Posted 4 years ago #

    @alchymyth
    Thanks so much for your code that I would be able to add an image to Settings/Discussion through functions.php for this site: http://www.mywebdesigncenter.com/blog

  10. CaroVonChaos
    Member
    Posted 4 years ago #

    when I add that bit of code to my funtions.php my entire theme is broken. what am I doing wrong? where is that code supposed to be in function.php?

  11. paulogoode
    Member
    Posted 3 years ago #

    @alchymyth

    Thank you so much for that code - it works perfectly. Just what I was looking for!

Topic Closed

This topic has been closed to new replies.

About this Topic