WordPress.org

Ready to get started?Download WordPress

Forums

Question about get_avatar and gravatar (2 posts)

  1. RyanColins
    Member
    Posted 5 years ago #

    I can get gravatars working fine using get_avatar, but my only problem is that the image it puts out doesn't have an alt tag. I'm trying to keep my pages w3c valid, and for that to happen, all images have to have an alt tag.

    I read up on the get_avatar function in the wordpress codex, but I didn't see anything on adding a alt value to the image that php outputs.

    Anyone know a way to fix this?

  2. whooami
    Member
    Posted 5 years ago #

    $avatar = "<img alt='' src='{$out}' class='avatar avatar-{$size}' height='{$size}' width='{$size}' />";
    } else {
    $avatar = "<img alt='' src='{$default}' class='avatar avatar-{$size} avatar-default' height='{$size}' width='{$size}' />";
    }

    a blank alt tag is valid. thats code right out of 2.6.2's pluggable.php (get_avatar)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags