Home>Support>Invalid img loading HTML attribute value in Slider widget

Invalid img loading HTML attribute value in Slider widget

SiteOrigin Image Slider widget generates images with

attribute. The only valid values for loading attribute according to HTML standards are “eager” and “lazy”. The value “1” is invalid.

In order to fix the invalid HTML, one needs to modify wp-content/plugins/so-widgets-bundle/widgets/slider/slider.php and change

'loading' => true
'loading' => 'eager'
on lines 171 and 201 (in version 1.17.8 of SiteOrigin Widgets Bundle)

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 1 year, 1 month ago Alex S Hi, I Work Here

    Hi Disassembler,

    Thank you for reporting this. This was done to avoid a WordPress bug when disabling lazy loading. You can read more about this change here. Let me know if you have any further questions.

    Kind regards,

  2. 1 year, 29 days ago Disassembler

    Hi Alex,
    Value “true” is not allowed in the loading parameter, see https://developer.wordpress.org/reference/functions/wp_get_attachment_image/ – only boolean false or a string is allowed. Setting ‘loading’ => true as it is now results in invalid HTML generated as , as per my original report (sorry about the formatting), hence I’m suggesting setting to a string value ‘eager’, which is allowed, results in valid HTML and still keeps the lazy loading disabled.

  3. 1 year, 29 days ago Disassembler

    *invalid HTML generated as

    <img src="..." loading="1">
  4. 1 year, 28 days ago Alex S Hi, I Work Here

    Hi Disassembler,

    I’ve forwarded your feedback to the rest of the team, and I’ll investigate this further shortly. If WordPress has resolved the issue related to using values other than false we’ll look towards changing this value to more valid options.


    Kind regards,

  5. 1 year, 12 days ago Disassembler

    I see that the proposed change has been merged into the develop branch on GitHub a few days ago. Eagerly (pun intended) looking forward to the next release. :) Thank you.

  6. 1 year, 12 days ago Andrew Misplon Hi, I Work Here

    Hahaha :) Thanks for checking in.

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More