• donky353

    (@donky353)


    I am trying to get the url of the avatar image using the get_avatar_url function, however it returns the default “grey” avatar and not the one uploaded by the user with your plugin. Is there something I can do to get this working or get the avatar image url from the plugin?

    Thanks

    https://www.ads-software.com/plugins/basic-user-avatars/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Jared Atchison

    (@jaredatch)

    Currently the plugin does not filter this function, but it’s definitely something we should look into adding in the future. I don’t have an ETA at the moment though.

    https://github.com/jaredatch/Basic-User-Avatars/issues/13

    Thread Starter donky353

    (@donky353)

    Jared,

    Thanks for the quick reply, its much appreciated. I look forward to the support being added.

    Thanks,

    iykyvic

    (@iykyvic)

    trying to filter the string in my functions.php file brought up the function already declared in wordpress includes, so i used a work-around.

    In my case all I just wanted was to re-style the avatar, as I was using the same call get_avatar() in my site header menu and in-page(two calls on the same page). each call required different styles to them.

    To solve this I styled the first call using the already existing css class photo(you can also use the avatar, avatar-default or avatar-96 classes).

    i used javascript to replace the class, width and height property of the second call see code below.

    <div id="text-center" class="text-center">
    						<?php echo get_avatar( $current_user->ID ); ?>
    </div>
    <script>
    document.getElementById("text-center").getElementsByTagName('img')[0].className = "userdp";
    document.getElementById("text-center").getElementsByTagName('img')[0].width = "130";
    document.getElementById("text-center").getElementsByTagName('img')[0].height = "80";
    </script>
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘get_avatar_url returns default avatar’ is closed to new replies.