This topic is: not resolved
- This topic has 0 replies, 1 voice, and was last updated 1 month, 3 weeks ago by .
Viewing 1 post (of 1 total)
Viewing 1 post (of 1 total)
- You must be logged in to reply to this topic.
These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.
Community Forums › Forums › Genesis Blocks › How to use a figure/picture tag for an image on the homepage (Monochrome Pro)?
Tagged: figure, picture tag for image, webp file
Hi,
I would like to use the a
<figure style="background-image: url(path/to/image.jpg); background-size: cover; background-repeat: no-repeat; height: 300px;">
<picture >
<source type="image/webp" srcset="path/to/image.webp">
<img src="path/to/image.jpg" alt="">
</picture >
</figure>
tag to specify different file types for the same image on the homepage of Monochrome Pro, i.e. mainly a webp file and if not supported by the browser a jpg file as fall back option.
In the block in the backend I can only select an image, i.e. alternative formats are not provided.
I guess I would have to do that in one of the theme files (.php) but I wouldn't know which one and how to incorporate this.
Maybe somebody has an example for that.
Thanks for your help.
Cheers,
Cesare
© 2023 WPEngine, Inc.