Support » Fixing WordPress » empty alt-tags in galleries

  • Hi,

    I use the new gallery function very often on my blog and I noticed that the alt-tags at the thumbnails and the medium sized pictures are empty, although I filled in the form.
    I already tried the gallery cleaner plug-in but it is not solving the problem.

    Does somebody knows a solution?

    Thank you,

Viewing 1 replies (of 1 total)
  • I just checked the media.php in the includes directory.

    // as per wp_get_attachment_image_src, but returns an <img> tag
    function wp_get_attachment_image($attachment_id, $size='thumbnail', $icon = false) {
    	$html = '';
    	$image = wp_get_attachment_image_src($attachment_id, $size, $icon);
    	if ( $image ) {
    		list($src, $width, $height) = $image;
    		$hwstring = image_hwstring($width, $height);
    		if ( is_array($size) )
    			$size = join('x', $size);
    		$html = '<img src="'.attribute_escape($src).'" '.$hwstring.'class="attachment-'.attribute_escape($size).'" alt="'.attribute_escape($alt).'" />';
    	return $html;

    it seems to be ok, the alt-attribute should be inserted.
    I hope you understand what I mean. Here is a example of my site:

Viewing 1 replies (of 1 total)
  • The topic ‘empty alt-tags in galleries’ is closed to new replies.