WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. actionbasic
    Member
    Posted 1 year 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!
    Brandon

    http://wordpress.org/extend/plugins/add-new-default-avatar/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic