no resized image for certain class
General Discussion
3
Posts
2
Posters
242
Views
2
Watching
-
hey lay team,
id like for a zoom-function that all imgs with .zoooom class are displayed in the original size and not resized
i used this snippet:
add_filter('wp_get_attachment_image_src', function($image, $attachment_id, $size, $icon) {
if (isset($GLOBALS['zooom_force_full_image']) && $GLOBALS['zooom_force_full_image'] === true) { $full = wp_get_attachment_image_src($attachment_id, 'full'); return $full ?: $image; } return $image;}, 10, 4);
add_filter('wp_get_attachment_image_attributes', function($attr, $attachment, $size) {
if (isset($attr['class']) && strpos($attr['class'], 'zooom') !== false) { $GLOBALS['zooom_force_full_image'] = true; } else { $GLOBALS['zooom_force_full_image'] = false; } return $attr;}, 10, 3);
--
and it works fine on desktop - but not on mobile
do you have an idea what i could do about it?
thank you!
-
K kooloo referenced this topic on
-
id like for a zoom-function that all imgs with .zoooom class are displayed in the original size and not resized
what do you mean with not resized?
ah, you mean it should show the full source.
so the issue is you're trying to zoom in on images in mobile and then your image gets blurry?
Online Users
Forgot your key, lost your files, need a previous Lay Theme or Addon version?
Go to www.laykeymanager.com