WP ImageViewer
WP ImageViewer
Description
ImageViewer is an image viewer inspired by Google Photo’s.
It may also look familiar to users of Ebay.com or Tweakers.net.
It provides a modal for images, similar to modals as lightbox, colorbox and fancybox, just in a somewhat more abstract way.
Features
- Smooth dragging and panning images.
- Support touch devices.
- Double tap to zoom in/zoom out.
- Pinch in / pinch out to zoom in/out.
- Snap view for easier panning and zooming experience.
- Exposed API to control zoom programmatically.
Anti-Features
- Clean user interface, no bells, no whistles, no horns.
- Lightweight code (no PHP, 2 JS files and 1 CSS file).
- No settings page (really).
- No database queries.
Upstream Project
You can look at Github for the original code.
This project is integrated in this WordPress plugin and all ready to use.
Compatibility
This plugin is compatible with ClassicPress.
Contributions
This plugin is also available in Codeberg.
Installation
Installation
- Install the plugin through the admin page “Plugins”.
- Alternatively, unpack and upload the contents of the zipfile to your ‘/wp-content/plugins/’ directory.
- Activate the plugin through the ‘Plugins’ menu in WordPress.
- That’s it.
It should just work on the standard WordPress gallery and images.
Faq
This plugin expects the same html layout as lightbox, colorbox and fancybox. The image/thumbnail should be inside a link, an a element.
That link should point to the main media image, not the attachment page or a custom link. Only when the link points to an image file, it will show the viewer,
You can go to Gallery > Other Options > Lightbox Effect-tab and select None for the Lightbox Effect.
This code should help you, you can change these default values and put this PHP code in the functions.php file of your theme (preferably a child theme).
<?php
function imageviewer_custom_options() {
?>
<script>
imageviewer_custom_options = {
zoomValue: 100,
snapView: true,
maxZoom: 500,
refreshOnResize: true,
zoomOnMouseWheel: true
};
</script>
<?php
}
add_action( 'wp_footer', 'imageviewer_custom_options' );
?>
Reviews
Not perfect, but nice
By alvincha on August 25, 2025
Basically I wanted something that resemble the "Photos Viewer Application" from Windows where you can zoom and pan on large images. This is the closest I found for now.
WP ImageViewer works nicely but there is a few things that prevent it from being perfect imo:
1- When you zoom in an image, it doesn't zoom where your cursor is but zoom at the bottom of the image automatically which is pretty annoying especially for large images
2- Since it's integrated to WP directly there isn't any easy customization available, you cant change the position of arrows for e.g. that are not vertically centered as in every Lightbox I can think of
3- Lightbox does not close when the user is clicking outside the image, I do like this in Lightboxes personnally
4- I don't think it's possible to separate the images within a page from the same Slider/Lightbox. What I mean is, if you have let's say 3 gallery of 5 images and use this plugin on all of them, you can't have 3 separate Slider with 5 images, you end up having a giant Slider where you can loop back to image number 1 from the very last image of the page. It would be nice to be able to separate them
5- Be able to change buttons icons would be nice even tho I guess it's possible by doing some extra work
简陋而优雅。Rough yet Elegent
By benyangovo on November 10, 2024
我的访客大多来自中国大陆,他们访问其他国家的网速会很缓慢。这就是为什么我一直寻找着能够自定义预览图和弹出大图尺寸的插件。其它的画廊插件通常不允许你自行设置这两个尺寸。但这个插件,它选择爬取原版Wordpress超链接指向的图片,这是一种相当巧妙的方式!而且它还提供了其它画廊插件所没有的缩放模块,我不敢相信这个插件目前的下载量只有仅仅300…
Most of my visitors are from mainland China, and their Internet speed to other countries is very slow. That's why I've been looking for plugins that can customize the preview image and pop-up large image size. Other gallery plugins usually don't allow you to set these two sizes yourself. But this plugin chooses to crawl the pictures pointed to by the original WordPress hyperlink, which is a pretty clever way! And it also provides a zoom module that other gallery plugins don't have. I can't believe that this plugin has only 300 downloads at present…
Simplicity and Functionality
By Cambabutonono on October 17, 2023
Why is this plugin great?
- Does what it says on the box.
- Integrates seamlessly with standard WordPress functionality.
- Enhances the standard WordPress functionality without changing it - remove the plugin, and you're back to standard WordPress without missing or broken blocks.
- Does not create unnecessary menu items and popups.
- Does not try to sell you anything.
This plugin embodies the simplicity and functionality that WordPress should offer, as opposed to the cluttered, ad-infested, slow, and buggy alternatives out there.
works great
By iskradi on August 2, 2023
Plugin works great.
Light and Right
By Josh Journey (ljosh) on July 18, 2021
Wonderful plugin
By Naomi Blindeman (naomiblindeman) on October 30, 2020
works great, supports ClassicPress
By werdpres on September 8, 2020
Simple & lightweight. All what I need
By flow92 on February 14, 2020
Works great with NextGen Gallery!
By (reggie3) on July 3, 2019
Simple and nice
By Marcel Pol (mpol) on March 10, 2019
Changelog
3.0.1
- 2026-02-04
- Fix arrow keys when viewer is inactive.
3.0.0
- 2026-01-13
- Rewrite jQuery into vanilla JavaScript.
- Support heif and avif images.
- Remove wp_imageviewer_show_callback.
2.0.7
- 2024-11-15
- Set z-index to 10000 for Twenty Twelve theme.
2.0.6
- 2022-10-28
- Add callback for after showing an image.
2.0.5
- 2021-08-12
- Add possibility to use custom options for the viewer.
2.0.4
- 2021-02-22
- Fix deprecated jQuery calls with WP 5.6 and jQuery 3.5.
2.0.3
- 2020-11-03
- Support images which have extra ?get parameters.
2.0.2
- 2020-10-19
- Do not slide on touch when zoomed in.
2.0.1
- 2020-02-21
- Fix check for active viewer.
2.0.0
- 2020-02-18
- Update to upstream 2.0.0 iv-viewer.
- Add navigation with arrow keys.
- Only add hide-event to ‘body’ once, not for every image.
- Only run expensive code when viewer is active.
1.2.0
- 2019-07-12
- Support Enter and Esc key to open or close viewer.
1.1.2
- 2019-04-16
- Do not swipe on multitouch.
1.1.1
- 2019-03-29
- Add z-index to close button.
1.1.0
- 2019-03-11
- Support touch events for swiping.
1.0.2
- 2019-01-03
- Slightly bigger navigation buttons again, should be less sticky.
1.0.1
- 2018-12-01
- Slightly bigger navigation buttons.
- Add z-index to navigation.
1.0.0
- 2018-11-30
- Initial release.