• Resolved Jek-fdrv

    (@jek-fdrv)


    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_right_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 1 replies (of 1 total)
  • Plugin Author WP Media

    (@wp_media)

    Hey @jek-fdrv,

    Thanks for sharing these details – unfortunately, this is not possible to do with Imagify.

    However, Imagify will optimize images in Media Library and not on the front-end. Regarding WebP, we will look for <img> tag, and as long as it exists on the front-end, we will be able to rewrite images to WebP.

    We can not control LazyLoad functionality as we do not have that feature built-in.

    ?Let me know if you need any further assistance, I am happy to help.

    Best Regards
    Marko

Viewing 1 replies (of 1 total)
  • The topic ‘I would like to generate different image size via php.’ is closed to new replies.