Hi!
I’ve looked at your code, and I believe I have found the issue. get_lazysizes_html
does not operate directly on the image src, but rather on a complete HTML string, containing an entire img tag. Taking this into account, the last part of your code might look something like this:
get_lazysizes_html(
'<img
class="featured-thumb' . ($animated_gif) ? ' featured-thumb-gif-class' : '' . '"
data-animated-gif-src-medium="' . $imgsrc[0] . '"
data-animated-gif-src-full="' . $animated_gif_imgsrc_full[0] . '"
src="' . $imgsrc[0] . '"
alt="' . mb_strimwidth(the_title_attribute('echo=0'), 0, 100, ' ...') . '"
style="width:' . $imgsrc[1] . 'px;height:' . $imgsrc[2] . 'px" />'
);
(quick untested sketch, note that I had to convert the html to php strings)
Hopefully this will help you solve the problem. Let me know if you have any more questions.
– Patrick Sletvold