You can just use the built in ThickBox. Maybe not the pretties library but it does its job.
Just add the class thickbox to the link and add the image to the href
Here is a simple example:
<?php echo '<a href="https://wordpress.stackexchange.com/questions/78749/image.png" class="thickbox">'. __('Test image', 'domain') .'</a>'; ?>
Read more about ThickBox here.
Related Posts:
- Local WordPress installation doesn’t crop images
- HTML Img with data:image src gets sanitized in admin?
- Edit Page did not get refresh after update
- Upload error on localhost (at minimum, not yet tested online)
- How to attach post ID to image links in WordPress tinymce editor
- Admin bar stats widget plugin image broken
- get_post_gallery_images returns thumbs . I want full size
- Remove P tags from images
- Any easy way to automatically set the first inline image in a post as the thumbnail?
- Upload multiple images in a custom metabox
- How can I hide media library images from general users?
- WordPress speed slow after .5 million single image post via wp-cli
- How to add php to theme to show alt attributes
- Why won’t these imported images show up?
- Remove rel=”attachment wp-att-XX”
- Using Taxonomy Image code with my get_categories code
- Generate image size, based on the image-orientation
- Rename image during upload using date and time stamp?
- How to Add extra option to Image Block Settings?
- Upload thousands of images to WordPress without plugin?
- Images in the Twenty Fourteen theme
- Automatically replace original uploaded image with large image size
- Problem with loading images from child theme CSS file with relevant path
- SEO images in Nextgen Galleries
- Watermark images only for some users
- Add an attribute to attachments
- Domain Change with New Image Sizes
- Why no images on a fresh WordPress installation?
- How to upload images in a specific folder using API
- AJAX – save an $_FILES picture in media library
- How to stop thumbnail generation from some images and different size thumbnail generate
- wordpress (woocommerce) add image to media library programmatically python
- Searching for any images in media library displays “no media found”
- How can I filter image HTML to add schema.org attributes?
- Get post attached image to display in admin dashboard
- How to get file URL from media library
- How to implement secure frontend image upload? [closed]
- Change media URL (images)
- Resize header image
- Problem with images when no dimension in the URL [closed]
- some images not appearing on the website after migration [closed]
- WP 5.3 Removing Default WordPress Image Sizes
- How do I get my main image to stretch the full length of the screen?
- WordPress images not cropping properly
- How to make my site use HTTPS for images or how to insert images as relative paths?
- HowTo: develop WP template with dynamic background image
- Featured Image or Post Thumbnail Displaying on index.php?
- Clicks registering on Preview DNS site
- A little confused as to what add image size actually does
- Get thumbnail URL :)
- What did I do WRONG?
- Add retina “2x” in attribute “srcset”
- Large image not showing dimensions in Media Library
- Change logo image condition based on url
- How to insert image path in database to display product image in wp-admin?
- Hiding Media Source Links
- How to create a title images for different posts?
- resize and crop thumbnail photos
- Broken thumbnails (sometimes) with TimThumb
- Can i have 2 separate Galleries on 2 separate pages each go to a DIFFERENT Attachment.php file?
- Why is my table background image not showing in wordpress?
- WordPress Media Library – how to “uncache” images
- Is there a way to add a featured image to an image/file attachment page?
- Media Library Cleanup A Thought Exercise
- Save media files (images) to database instead of the filesystem
- WordPress Multisite: Images moved to /sites/1?
- Site only working in browser where I created it
- After migration, all featured images using accentued characters in their file names are displayed “blanked”
- Adding numbers to an image based on co-ordinates
- A query to substitute images paths in gutenberg (website migration)?
- link not working in image section
- Images missing from Blog post page
- Page size too big due to images
- Full size image from srcset ALWAYS used on mobile DESPITE setting size of image in editor
- Run function before uploaded image is saved
- Are WP images responsive by default?
- Prevent WordPress from creating individual size images
- wordpress images not showing properly
- Keep the original ratio in a thumbnail image
- What is the best way to handle Ajax image upload on front end?
- How can I set different banner images using background cover at different breakpoints?
- variable crop option with add_image_size()
- Plain image uploading – no links, no classes, no sizes
- Thumbnail gallery by date and taxonomy
- Images with excerpt function
- How do I get resized thumbnails?
- How do I embed an image at actual size?
- Display ajax preloader for large images within posts
- Uploading Full Size Image vs Resizing Before Upload
- Insert image doesn’t pickup right size
- Storing images on a local site
- Images will not attach to posts after site migration
- Tried everything but Facebook share button won’t load the post thumbnail
- Set image dimension for WP_Customize_Image_Control images
- Stop underlining image links
- How to hide image alt text/caption in Visual Composer?
- How to get attached image alt text in media.php?
- Why some images are not allowed to be edited only for thumbnails?
- problems with alt text not appearing in source code
- Images have dissapeared from media library and site