Add New Default Avatar
Modify to randomize Default Avatar? (1 post)

  1. actionbasic
    Posted 3 years ago #

    Greetings! I have been trying for days to find a solution to this problem. I've used a bunch of code that does what your plugin does, such as this:

    if ( !function_exists('fb_addgravatar') ) {
    function fb_addgravatar( $avatar_defaults ) {
    $myavatar = get_bloginfo('template_directory') . '/images/avatars/avatar_' . (string) rand(1,5) . '.png';
    $avatar_defaults[$myavatar] = 'Users';
    return $avatar_defaults; }
    add_filter( 'avatar_defaults', 'fb_addgravatar' ); }

    But your plugin is a nice option and works well with the Local Avatar plugin. I'm wondering if there is a way to modify the plugin to pick from a folder of avatars and assign a random avatar (say out of a folder of 10) to all commenters without an Avatar.

    Any help or ideas would be GREATLY appreciated!

    Thank you and great plugin!


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Add New Default Avatar
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic