Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi there,

    You can try adding this filter.

    function filter_gravatar_alt($img) {
    	if ( have_comments() ) {
    		$alt = 'your alt in comments';
    	}
    	else {
    		$alt = 'your gravatar alt for the rest of the pages';
    	}
    	$img = str_replace('alt=\'\'', 'alt=\''.$alt.'\'', $img);
    	return $img;
    }
    add_filter('get_avatar', 'filter_gravatar_alt');

    You can change the value of $alt.

    Thread Starter aguirresf

    (@aguirresf)

    Thanks a lot @ejcabquina

    I’ll try it out and will reply shortly.

    No problem. Let us know how it goes. 😀

    Thread Starter aguirresf

    (@aguirresf)

    Hello again @ejcabquina,

    It works just fine, thank you very much 🙂

    Thread Starter aguirresf

    (@aguirresf)

    I’m closing the thread.
    Keep up the great work!

    Nice one. Glad it works for you. Thanks for letting us know. 😀

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Alt attribute in gravatar images’ is closed to new replies.