Open kavyagokul opened 1 year ago
@kavyagokul please assign me this feature. I will work on its source code to include this feature as required. Please share some helpful resources and the code file( html files, if any).
Site-wide Lightbox plugins usually consider those images as a candidate to be shown in the lightbox which link to their underlying media file or their media attachment page.
https://wordpress.org/plugins/tags/lightbox/ yields the following plugins:
Easy Fancybox (300k installations)
[…] gives you a flexible and aesthetic light box solution for just about all media links on your website […] After activation, all links to JPG, GIF and PNG images are automatically opened in the FancyBox […]
👉 Mechanism: Linked image gets picked up.
Simple Lightbox (100k installations)
Automatically activate links (no manual coding required) […] Supports WordPress image attachment links […]
👉 Mechanism(s): Link to media file, link to media page (aka “image attachment link”)
FooBox Responsive Media Lightboxes (100k installations)
Within Gutenberg, FooBox lightbox will automatically add a modal popup to images and galleries that have the “Link To” setting set to “Media File”. […] FooBox will automatically add modals to WordPress galleries, WordPress images with captions, and attachment images. […]
👉 Mechanism(s): Link to media file, attachment images (very old WordPress mechanism)
Lightbox with PhotoSwipe (20k installations)
All linked images in a post or page will be displayed using PhotoSwipe, regardless if they are part of a gallery or single images. Just make sure that you link the image or gallery directly to the media and not the attachment page (in galleries the option link=file should be set).
👉 Mechanism(s): Link to media file
Links to: (•) None ( ) Media File ( ) Custom
<img src="/path/to/media-file">
shall become:
<a href="/path/to/media-file"><img src="/path/to/media-file"></a>.
What problem does this address?
Right now, the block only offers the option to hyperlink the image with the post's link. It would be nice to have other media link options, such as the ones offered by the Image block: media file and attachment page.
What is your proposed solution?
It would be nice to have the option to let the visitor click on the featured image to open the actual image on a new tab, so it can be downloadable for example. The Cover block is another option to show the post's featured image, but it also doesn't offer a way to hyperlink the image.