-
Dear Team,
I wish you and your families a Merry Christmas and a Happy New Year.
Following Problem:1. I uploaded my hero picture
For desktop, it is top causing no problems.2. But the Lighthouse Page is giving me following Error:
https://imgur.com/a/oGqvd1m– I changed the format to WEBP
– I made the size smaller
– But I can’t change the size; otherwise, it will not fit my desktop page
– No clue what to doDomain: https://www.ihrcoachinginstitut.de
Picture URL: https://www.ihrcoachinginstitut.de/wp-content/uploads/2024/03/Coaching-Frankfurt-Coach-Frankfurt-am-Main-Agile-Coach-Life-Coach-Coaching-Ausbildung-Systemischer-Coach-Business-Coaching-Frankfurt-am-Main-Systemisches-Coaching-2-1.webpCan you please help.
Tim
-
Hi Tim,
Your image is already a responsive image, which size to render depends on the browser.
Try this PHP snippet to modify the browser render behaviour:
function db_modify_srcset_sizes($sizes, $size) { $sizes = '(max-width: 420px) 100px, (min-width: 421px) 768px, (min-width: 769px) 1024px, 100vw'; return $sizes; } add_filter('wp_calculate_image_sizes', 'db_modify_srcset_sizes', 10 , 2);Adding PHP: https://docs.generatepress.com/article/adding-php/
It should load the 300px image on mobile.Let me know if this helps!
- You must be logged in to reply to this topic.