• Thanks for a great plugin!

    I use some ajaxified features on my page for popups and some other stuff. The wp_get_attachment_image_url return the original image url in those places. Is there a way for me to manually fetch that webp in my code from attachment id or image url?

Viewing 3 replies - 1 through 3 (of 3 total)
  • try adding .webp to the called file name, this should trigger the converter and in result generate a webp file if it doesn’t exist after which it will be displayed to your visitors. Also make sure to use option “append .webp” instead of rename, so that your images will look like this: image.jpg.webp – then this will work.

    • This reply was modified 3 years, 6 months ago by robaczek1.
    Thread Starter Jonas Hjalmarsson

    (@jonashjalmarsson)

    I’m using CDN friendly setup with alter html setting activated. So your suggestion didn’t work for me. There are no way to hook or filter in an other way when I fetch my image?

    You said wp_get_attachment_image_url return the original image url in those places, so you need a piece of jacascript coding that will grab this original image url and change it by adding .webp at the end that will in turn fire up the converter or simply display a webp version if it already exists. That’s how my programmer did this on my website and it works.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Manually trigger webp filter’ is closed to new replies.