- This topic has 8 replies, 4 voices, and was last updated 4 years, 9 months ago by
David.
-
AuthorPosts
-
June 14, 2021 at 10:16 am #1821922
Elizabeth
Hi! I’m working on a new website that uses header elements with background images. All images in the image library have a corresponding .webp version.
Is it possible to use the WebP versions of the images in the Background Element in the header elements? Here’s an example page https://itfpharma.candyappledev.com/therapeutic-areas/.
Thanks,
LizaJune 14, 2021 at 11:48 am #1822002Ying
StaffCustomer SupportHi Elizabeth,
If the Webp image has already been uploaded to media, you should be able to select it as the background image in the header element.
Let me know if you need further assistance 🙂
June 14, 2021 at 2:49 pm #1822131Elizabeth
Hi Ying,
Thank you for getting back to me so quickly. I’m using Imagify to generate WebP versions of the images. I don’t have an option of which version of the file to use when I’m editing the header elements.
Liza
June 14, 2021 at 7:13 pm #1822235Elvin
StaffCustomer SupportHi Elizabeth,
I believe Imagify can’t convert images displayed through background-image CSS property.
The way to go about this if you wish to use webp as background image is to either:
Manually convert the image into webp format, re-upload it to media library and re-apply it to where you want it applied.
Or,
Ask Imagify what function from their plugin outputs the URL webp image and use that for the PHP code snippet write-up in generating a new CSS to use that webp image URL as background image.
The PHP coding writeup will be simple. I can help you with that but we’re not exactly sure how Imagify outputs the webp URL. It’s a third-party plugin so it’s out of our scope, unfortunately.
June 15, 2021 at 6:22 am #1822776Elizabeth
Hi Elvin,
Thank you for helping to clarify this. Imagify simply adds .webp to the end of the original file – for example https://itfpharma.candyappledev.com/wp-content/uploads/2021/04/Womens-Health-Header.jpg.webp.
I appreciate your help with the PHP code to accomplish this.
Elizabeth
June 15, 2021 at 7:30 am #1822834David
StaffCustomer SupportHi there,
have you checked with Imagify ? I believe they have a Rewrite Rules Method in the plugin that will allow CSS Background images to be converted.
June 15, 2021 at 9:42 am #1823194Elizabeth
Hi David,
No, I haven’t checked with Imagify, but should have thought of it. I’ll check now and let you know what I find out.
Thanks,
ElizabethJune 15, 2021 at 9:56 am #1823200Elizabeth
Hi David,
Imagify does have an rewrite rules setting, which I completely overlooked, and it did the trick. Thank you for thinking of this!
Elizabeth
June 15, 2021 at 2:01 pm #1823410David
StaffCustomer SupportGlad to be of help
-
AuthorPosts
- You must be logged in to reply to this topic.