Home › Forums › WoodMart support forum › WebP in AJAX search
WebP in AJAX search
- This topic has 15 replies, 3 voices, and was last updated 3 years, 11 months ago by Artem Temos.
-
AuthorPosts
-
December 7, 2020 at 9:30 pm #248689
lucablight2ParticipantHello,
Sińce im uploading a lot of images, I’ve decided to go with WebP format to increase site performance.I’ve added following to functions:
<?php /** * Enqueue script and styles for child theme */ function woodmart_child_enqueue_styles() { wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css', array( 'woodmart-style' ), woodmart_get_theme_info( 'Version' ) ); } add_action( 'wp_enqueue_scripts', 'woodmart_child_enqueue_styles', 10010 ); //** *Enable upload for webp image files.*/ function webp_upload_mimes($existing_mimes) { $existing_mimes['webp'] = 'image/webp'; return $existing_mimes; } add_filter('mime_types', 'webp_upload_mimes'); //** * Enable preview / thumbnail for webp image files.*/ function webp_is_displayable($result, $path) { if ($result === false) { $displayable_image_types = array( IMAGETYPE_WEBP ); $info = @getimagesize( $path ); if (empty($info)) { $result = false; } elseif (!in_array($info[2], $displayable_image_types)) { $result = false; } else { $result = true; } } return $result; } add_filter('file_is_displayable_image', 'webp_is_displayable', 10, 2);
And it’s working fine by now, the only issue is that main product thumbnail is not displayed in Ajax search result – it only shows jpg format.
Is there any way to add action to display WebP thumbnail in Ajax search ?
Attachments:
You must be logged in to view attached files.December 8, 2020 at 7:08 am #248788
Artem TemosKeymasterHello,
This image has a size of
1x1
probably caused by some automatic process https://prnt.sc/vy0epk
You need to specify the correct size for your product images in Appearance -> Customize -> WooCommerce -> Product images. Then install theRegenerate Thumbnails
plugin and regenerate all thumbnails on your website.Kind Regards
December 9, 2020 at 7:02 pm #249350
lucablight2ParticipantHello,
Thank you for that instructions – it helped.
Now I’m facing a different problem with thumbnail.
I want to change image size for Information Box element.I’ve added my custom thumbnail size to WordPress functions – 200 width.
When I change the size of the information box image – elementor get’s it right.
But after I publish, its stays the same. I’ve cleared cache- and it didn’t help.Images in attachment
Attachments:
You must be logged in to view attached files.December 10, 2020 at 7:07 am #249459
Artem TemosKeymasterHi,
Could you please send us a link to your website where we can see this issue?
Kind Regards
December 10, 2020 at 10:00 am #249540
lucablight2ParticipantHello,
Of course, here it is.December 10, 2020 at 12:08 pm #249582
Artem TemosKeymasterTry to add the following code snippet to the Custom CSS area in Theme Settings to fix this issue. And on that page we see that all images are in the same size.
.woodmart-lazy-load { width: auto; }
December 10, 2020 at 2:05 pm #249643
lucablight2ParticipantHello,
That didn’t help.I want all infobox images to be 200px widght the custom thumbnail I created name is ‘szeroki-thumb’. And beside first 3 infobox images – all the rest is set to that thumbnail.
December 10, 2020 at 2:50 pm #249652
Artem TemosKeymasterHello,
Could you please disable all plugins that are not related to our theme and provide us your admin access so we could check it?
Thank you in advance
December 11, 2020 at 2:18 am #249809
lucablight2ParticipantHello,
Here you go
December 11, 2020 at 7:48 am #249868
Artem TemosKeymasterIt looks like you are using
webp
images. Currently, Elementor doesn’t have full support for it. As you can see, images can’t be resized to a custom size when you use them inside the Elementor elements.December 14, 2020 at 9:42 am #250777
lucablight2ParticipantAwesome thank you for reply.
I used general Elementor widget -“Image Box” and it worked.
It seem’s that its not working with your element’s.December 14, 2020 at 9:54 am #250782
Artem TemosKeymasterEven with the default element, the image is not resized. You see the image smaller because of special CSS styles https://prnt.sc/w29gzo
If you want, we can reduce our theme’s infobox image with CSS for you.December 14, 2020 at 11:13 am #250808
lucablight2ParticipantOh I get it now.
Thank you for detail on that.If you want, we can reduce our theme’s infobox image with CSS for you.
Would be great
December 14, 2020 at 12:09 pm #250823
Artem TemosKeymasterTry to add the following code snippet to the Custom CSS area in Theme Settings to do this
.woodmart-info-box .info-box-icon { width: 40%; }
January 12, 2021 at 8:59 pm #257817
MensroParticipantHello, good work.
I definitely need help with this. I’m looking for a guide on what to do to support the WEBP format.
January 13, 2021 at 7:04 am #257896
Artem TemosKeymasterHello @Mensro,
Currently, we don’t have a guide on how to implement Webp on your website. But you can try to use the Imagify plugin that adds such ability.
Kind Regards
-
AuthorPosts
- You must be logged in to create new topics. Login / Register