Images & SEO

Stagger Lee
1796 Posts
Stagger Lee posted this 30 May 2015

ALT, Titles for media atatched images are empty and it is not so good for SEO.
Can you at least add Page/Post title to ALT and Title in images. Better than anything. Artisteer did it well, dont know why you removed it.

If developers can make check if alt, title exist in attachment, and use manual entered Alt, Title it would be good, If not even this change is more than welcome.

functions.php, line 376:

$title = theme_get_array_value($args, 'title', get_the_title());

Lines 384, 392:

the_post_thumbnail($size, array('alt' => $title, 'title' => $title, 'class' => $img_class));

$result = '<img src="' . $img[0] . '" alt="' . $title . '" width="' . $img[1] . '" height="' . $img[2] . '" title="' . $title . '" class="'. $img_class .'" />';

ALT, Titles for media atatched images are empty and it is not so good for SEO. Can you at least add Page/Post title to ALT and Title in images. Better than anything. Artisteer did it well, dont know why you removed it. If developers can make check if alt, title exist in attachment, and use manual entered Alt, Title it would be good, If not even this change is more than welcome. **functions.php, line 376:** $title = theme_get_array_value($args, 'title', get_the_title()); **Lines 384, 392:** the_post_thumbnail($size, array('alt' => $title, 'title' => $title, 'class' => $img_class)); $result = '<img src="' . $img[0] . '" alt="' . $title . '" width="' . $img[1] . '" height="' . $img[2] . '" title="' . $title . '" class="'. $img_class .'" />';

Last edited 30 May 2015 by Stagger Lee

Vote to pay developers attention to this features or issue.
6 Comments
Order By: Standard | Newest
Stagger Lee
1796 Posts
Stagger Lee posted this 30 May 2015

Some temporary solution to not be dependent of Themler code. It works on featured image and doesnt touch post images, what is good. Anyway image titles in post images are removed since WP 3.5.

function isa_add_img_title( $attr, $attachment = null ) {
    $attr['title'] = the_title_attribute( 'echo=0' );
    return $attr;
}
add_filter( 'wp_get_attachment_image_attributes','isa_add_img_title', 10, 2 );

function isa_add_img_alt( $attr, $attachment = null ) {
    $attr['alt'] = the_title_attribute( 'echo=0' );
    return $attr;
}
add_filter( 'wp_get_attachment_image_attributes','isa_add_img_alt', 10, 2 );

Some temporary solution to not be dependent of Themler code. It works on featured image and doesnt touch post images, what is good. Anyway image titles in post images are removed since WP 3.5. function isa_add_img_title( $attr, $attachment = null ) { $attr['title'] = the_title_attribute( 'echo=0' ); return $attr; } add_filter( 'wp_get_attachment_image_attributes','isa_add_img_title', 10, 2 ); function isa_add_img_alt( $attr, $attachment = null ) { $attr['alt'] = the_title_attribute( 'echo=0' ); return $attr; } add_filter( 'wp_get_attachment_image_attributes','isa_add_img_alt', 10, 2 );
Support Team posted this 19 June 2015

Hello Stagger Lee,
your suggestion is included into Themler and will be available in the next update.
Special thank you for this suggestion and solution from our engineers.

Regards,
Aileen

Hello Stagger Lee, your suggestion is included into Themler and will be available in the next update. Special thank you for this suggestion and solution from our engineers. Regards, Aileen
Stagger Lee
1796 Posts
Stagger Lee posted this 19 June 2015

Thank you.
Forgot, attachment title is automatically fileld by WordPress from filename. So there is not much to do. Only if code can compare filename and title, and see if title is our own or from filename.

Thank you. Forgot, attachment title is automatically fileld by WordPress from filename. So there is not much to do. Only if code can compare filename and title, and see if title is our own or from filename.
jdobbsy1987
23 Posts
jdobbsy1987 posted this 19 June 2015

Are you able to clarify what you mean by this please?

I'm not trying to correct or prove anything, simply want to understand what you mean as anything that will improve SEO will be nice to know.

My current understanding is when i add an image in Themler i can create the ALT text.

What is the above suggestion for / going to do?

Cheers,
Jamie

Are you able to clarify what you mean by this please? I'm not trying to correct or prove anything, simply want to understand what you mean as anything that will improve SEO will be nice to know. My current understanding is when i add an image in Themler i can create the ALT text. What is the above suggestion for / going to do? Cheers, Jamie
Stagger Lee
1796 Posts
Stagger Lee posted this 20 June 2015

It is not for Themler added images, but for WordPress added images. And template tags for SEO.

It is not for Themler added images, but for WordPress added images. And template tags for SEO.
jdobbsy1987
23 Posts
jdobbsy1987 posted this 20 June 2015

i see, cheers

i see, cheers
You must log in or register to leave comments