Hi,
I am using the thumb function to provide every 100 Pixel a new image. I am currently using this code:
<img src="<?php echo thumb($image, array('width' => 800, 'height' => 537, 'quality' => 70, 'crop' => true), false) ?>" class="thumbs" alt="<?php echo $project1->title()->html() ?>"
sizes="(min-width: 64em) 33vw, (min-width: 40em) 50vw, 100vw"
srcset="
<?php echo thumb($image, array('width' => 100, 'height' => 67, 'quality' => 70, 'crop' => true), false) ?> 100w,
<?php echo thumb($image, array('width' => 200, 'height' => 134, 'quality' => 70, 'crop' => true), false) ?> 200w,
<?php echo thumb($image, array('width' => 300, 'height' => 201, 'quality' => 70, 'crop' => true), false) ?> 300w,
...
">
I wanna go up until 1600 - this works well if I type everything, but for some future project I want to find an easier solution. This is with what I came up until now - but it’s not working. Please help - and yes, I am pretty new to PHP
<img src="<?php echo thumb($image, array('width' => 800, 'height' => 537, 'quality' => 70, 'crop' => true), false) ?>" class="thumbs" alt="<?php echo $project1->title()->html() ?>"
sizes="(min-width: 64em) 33vw, (min-width: 40em) 50vw, 100vw"
srcset="
<?
$var1 = 1;
while ($var1 < 16) {
echo thumb($image, array('width' => $var1*100, 'height' => $var1*100/1,489, 'quality' => 70, 'crop' => true), false) $var1*100w ?>,
$var1++;
}
?>
">
Thanks for any help!