1
votes

Weird one here.

I have a Wordpress site with Woocommerce.

When I add products, and add a product image, I get a broken link in both admin and the live site. Both on the product list page and within the product.

The product image link itself is ok, the problem is the srcset attribute. The wrong path is set - it repeats the year and month ..

http://photographybyjean.eu/wp-content/uploads/2017/01/2017/01/city-photo-600x600.jpg 600w,
    ... 

Removing the srcset attribute in Chrome Dev tools confirms that is the issue, because then the correct image is displayed.

Does anyone know where the Woocommerce php code for this is? I could easily fix it if I knew where it was generated from...

Oh, I am using the "ShopIsle" theme in case that matters.

EDIT: found the code - but it just calls wp_get_attachment_image_srcset :-( Surely the WP core can't be broken??? Any ideas?

1
I think it has something to do with the full size size of the original image ... smaller ones do not get a srcset, and so work.kpollock
still don't work on the product page itself...kpollock
Have the same issue. Is this resolved?Keith Donegan
I am ashamed to say that I am sure I solved the issue but I can't recall how... super sorry... If I get time, I will go back and look at my site. Sorry again.kpollock

1 Answers

0
votes

We are on WordPress 4.9.5 and recently encountered the same issue. Image SRC attribute is fine but SRCSET images have incorrect path. As a result the image is not displayed and browsers show fail message about unloaded image. Removing SRCSET attribute fixes the issue. I suspect a WordPress bug for causing the issue. My current solution is to use filters to disable SRCSET from rendering and that fixed the problem.