• bing SEO Analyzer: “The <img> tag does not have an ALT attribute defined.”
    This is my Gravatar image that bing is calling out.

    I had this code originally:

    <div id="author-avatar">
    <?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyten_author_bio_avatar_size', 60 ) ); ?>
                           <div id="author-avatar">

    Just found in a past forum; (Otto 3yrs ago) and changed to this:

    echo get_avatar( $comment, '60' );

    [Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

    As Otto says; “Let the upstream code take care of the email”.

    But? still no image associated text. I would like to generate my own ass.text, something like: American Company / US Product Commenter Gravatar
    Can someone help?
    Thanks in advance for a reply.
    site: https://www.b4usa.com/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter SteveXK

    (@stevexk)

    Repeat with backticks.

    Code at this time:

    <div id="author-avatar">
                     <?php echo get_avatar( $comment, '60' ); ?>            
    
    	<div id="author-avatar">

    Answer found 10 months later:

    Just paid a visit to: https://tscadfx.com/alt-title-tags-gravatars-wordpress/
    Found this code:

    function replace_content($text)
    {
    $alt = get_the_author_meta( 'display_name' );
    $text = str_replace('alt=\'\'', 'alt=\'Avatar for '.$alt.'\' title=\'Gravatar for '.$alt.'\'',$text);
    return $text;
    }
    add_filter('get_avatar','replace_content');

    Changed some of it to suit the b4usa website:

    function replace_content($text)
    {
    $alt = get_the_author_meta();
    $text = str_replace('alt=\'\'', 'alt=\'Avatar for '.$alt.'\' title=\'USA Product or Service Commenter Avatar '.$alt.'\'',$text);
    return $text;
    }
    add_filter('get_avatar','replace_content');

    and added it to the functions.php file. and.. WaLa!!
    Thanks Todd Robertti.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Need Associated text for Gravatar / No Plugin’ is closed to new replies.