• Resolved vale0911

    (@vale0911)


    Hello,

    I’m developing a custom theme, and I’m using custom image sizes. Currently the plugin only converts the standard wp thumbnail sizes, which I don’t use in my ACF blocks.

    Is there a way to force the plugin to convert all image sizes to webp?

    Best,
    Val

Viewing 1 replies (of 1 total)
  • Plugin Support Joseph Grainger

    (@joegrainger)

    Hi @vale0911

    Thanks for getting in touch!

    The plugin provides a filter where you can customise the image sizes to generate WebP. You can use the webp_uploads_image_sizes_with_additional_mime_type_support filter to add the additional image sizes you need.

    Here is an example of how this can be used to add additional image sizes. The sizes array returned uses the image size name as the key and true as the value to have that image size generate a WebP version.

    add_filter(
    	'webp_uploads_image_sizes_with_additional_mime_type_support',
    	function( $sizes ) {
    		$sizes['allowed_size_400x300'] = true;
    		return $sizes;
    	}
    );

    Hope this helps!

    Let me know if you have any other questions

    Thanks

    • This reply was modified 2 years, 1 month ago by Joseph Grainger. Reason: code formatting
Viewing 1 replies (of 1 total)
  • The topic ‘Custom image sizes not converted to WebP’ is closed to new replies.