I would like to generate different image size via php.
-
Hi there, i use very custom build, and i create the src set list of images my self via php. I would like to use your nice plugin to control when and how to resize, generate webp image and if it should has lazy load or not my self in php. Example:
In the page tempalte:
get_right_image($image_id, '300px');
In functions.php
function get_post_image($image_id, $size) { $popular_device_sizes = [1440, 921, 769, 390]; foreach($popular_device_sizes as $img_size) { $srcst[] = generate_ShortPixel($image_id, $img_size); } return ' <img src="'.$srcst[0]['src'].'" srcset="'.implode(', ', $srcst).'" >';
}`
So do you have a function some like generate_ShortPixel ?This is only very roughly code example, not the real one.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘I would like to generate different image size via php.’ is closed to new replies.