Alt attribute missing - by Nico313 - on WordPress WooCommerce support

This topic has 12 replies, 3 voices, and was last updated 5 years, 6 months ago ago by Rose Tyler

  • Avatar: Nico313
    Nico313
    Participant
    February 1, 2018 at 16:10

    Hi,

    Is missing Alt attribute in /legenda/woocommerce/content-product.php line 78. (or see picture)

    This issue is detected by Bing Webmaster SEO Suggestions.

    Thank you for your help.

    Best regards.

    Please, contact administrator
    for this information.
    11 Answers
    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    February 2, 2018 at 12:35

    Hello,

    Please clear cache and check now. We’ve made changes in legenda/woocommerce/content-product.php.

    Regards

    Avatar: Nico313
    Nico313
    Participant
    February 2, 2018 at 12:42

    Hi,

    Not Work. What change ?
    "if ( $hoverImg == '' ) $hoverImg = '<img src=' . $hoverUrl . ' alt />';" ?

    Regards.

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    February 2, 2018 at 13:07

    Hello,

    I’m not sure if understand your request. Please scan the site now using the plugin. If if you will be not satisfied with result, please explain the problem with more details for better understanding.

    Regards

    Avatar: Nico313
    Nico313
    Participant
    February 2, 2018 at 13:59

    Hi, Sure.

    On hover, the image Change :
    – First image do not show alt informations.
    – Second image (.hide-image) shows alt informations.

    For SEO, we nned to have a maximum of image with alt attribute filled

    You can see an exemple on the following link.

    Regards.

    Please, contact administrator
    for this information.
    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    February 2, 2018 at 14:54

    Hello,

    Unfortunately, the function that used to show the hover image does not include the alt for the image. Will be ok for you if hover image has the same alt as the main image?

    Regards

    Avatar: Nico313
    Nico313
    Participant
    February 2, 2018 at 15:11

    Hi Olga,

    Thank you for your answer.

    No, it can’t be the same. I prefer ther is none alt attribute.

    It is a bad news. It is really complicate to change the function ? May you work on it for an other update ? It will be great for SEO.

    Best regards.

    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    February 2, 2018 at 16:22

    We can replace existing featured image by the first image from the product gallery. Then you’ll get 2 different alts. As I can see that you actually use the gallery image for the featured image, so this will be a good solution for you. What do you think?

    Regards

    Avatar: Nico313
    Nico313
    Participant
    February 2, 2018 at 16:59

    Ok, let’s try. It will be good.

    Thank you.

    Could you tell me if you change other things that legenda/woocommerce/content-product.php line 75

    if ( $hoverUrl != '' ) {

    Best regards.

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    February 5, 2018 at 10:23

    Hello,

    We’ve made changes in child-theme/woocommerce/content-product.php Please check now.

    Regards

    Avatar: Nico313
    Nico313
    Participant
    May 9, 2019 at 16:18

    Hi,

    Since last version of Legenda there two issue on /woocommerce/content-product.php :

    1- line 83 : miss ” ” for alt $hoverAlt.
    Solution : alt=" '.$hoverAlt.' ">';

    2 – Alt for swaped image dont work : it display the same ALT of the first image.
    Solution :
    Replace ` elseif ( $product->get_image() ) {
    $img_id = get_post_thumbnail_id($post->ID);
    $hoverAlt = get_post_meta($img_id , ‘_wp_attachment_image_alt’, true);
    }`
    By` elseif ( $product->get_gallery_image_ids() ) {
    $attachment_ids = $product->get_gallery_image_ids();
    $hoverAlt = get_post_meta($attachment_ids[0] , ‘_wp_attachment_image_alt’, true);
    }`

    i’m not sure it is correct but it work.

    Regards

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    May 10, 2019 at 12:31

    Hello,

    Thanks for contacting us.
    I’ve sent this information to our developers. They will check and add fixes in the next update of the theme.

    Regards

  • Viewing 12 results - 1 through 12 (of 12 total)

You must be logged in to reply to this topic.Log in/Sign up

8theme customization service
We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.