Support » Plugin: WebP Express » Alter HTML removes styling

  • Hello,

    If I enable the option to alter the html, the plugin causes the styling of the images on this page to be removed.

    See this screenshot:

    WebP Express DISabled
    <span class="et_shop_image"><img width="300" height="300" src="" class="attachment-woocommerce_thumbnail size-woocommerce_thumbnail" alt=""><span class="et_overlay"></span></span>

    WebP Express ENabled
    <span class="et_shop_image"><picture><source srcset="" type="image/webp"><img width="300" height="300" src="" class="attachment-woocommerce_thumbnail size-woocommerce_thumbnail webpexpress-processed" alt=""></picture><span class="et_overlay"></span></span>

    Problem is ‘fixed’ if I disable the ‘alter html’ setting. I am only reporting it in case you want to see if there is a better solution.

    Thank you

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Yes, the safest option is to choose the 2nd option for the replacing images. Instead of using the <picture> element option, choose to rewrite or update the element instead. The issue is your theme is probably not equipped to handle a <picture> element or there is styling applied to that element which is throwing off your layout. If you choose to just manipulate the image tags instead of inserting picture elements then you are not really introducing new markup into your theme, just the SRC attribute on the element should change.

    Thanks @shorelinechrism

    Yes, the second option works. I never considered this because of the warning where it says it doesn’t work with caching plugins. But it looks like it does with WP Fastest Cache.

    The issue is only on the woo shop page images by the way. All other image stylings are correct with the <picture> tag.


Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.