This solution is not an official thing yet. It uses JIG's Custom links feature. By using this method you lose the ability to custom link. Retina Ready feature will be essentially off, as it depends on TimThumb. Furthermore it's only available for images of the WordPress Media Library.
- Go to the Lightboxes tab > Maximum size for lightbox (the image will link to this size) and choose the smallest possible size. This will be used for thumbnail. If your desired size is not there, you need to add the name of the image size by hand to the shortcode, such as:1lightbox_max_size=medium
- Go to the General settings > Custom link's target and choose Lightbox: video / iframe / different image option to open the automatically custom-linked full size image in the lightbox.
- Go to TimThumb & CDN tab > U and choose
- What actually does the magic is the following code, that you add to the functions.php of your (child) theme:
1 2 3 4 5 6 7 8 9 | function jig_change_custom_link_on_the_fly($metadata, $object_id, $meta_key, $single) { if(isset($meta_key) && $meta_key == '_jig_image_link'){ $src = wp_get_attachment_image_src($object_id, 'full'); return $src[0]; } // Return original if the check does not pass return $metadata; } add_filter('get_post_metadata', 'jig_change_custom_link_on_the_fly', 10, 4); |
Please note that this workaround is known to cause problems with PhotoSwipe lightbox, limiting the size of the photo in it.