Lightboxes, or modal overlays, are commonly used to present large images and other media on a website. Although there are numerous plugins in the WordPress Plugin Directory that offer a similar functionality, I decided to create my own.
The lightbox script of my choice is prettyPhoto, mainly because it is visually appealing, exceedingly versatile and yet still relatively lightweight (~ 21 kb minified, ~6 kb minified & gzipped). prettyPhoto is a jQuery lightbox clone that supports a wide range of different media types including images, videos (YouTube, vimeo or the like), Flash, iframes and inline content, making it a “full blown media lightbox”.
prettyPhoto is being developed by Stephane Caron, who kindly agreed to change the licensing terms of his code to make it GPL compatible following a request by the WordPress plugin support team. As the developer states, prettyPhoto is “totally free to use (…) in all projects, even commercial ones”. For detailed information on prettyPhoto please visit the project page.
Please consider donating to the developer to support prettyPhoto.
The prettyPhoto Media plugin offers a convenient way to add the prettyPhoto lightbox / modal overlay functionality to any WordPress post or page.
- includes the latest prettyPhoto v3.1.4 script (pulled from https://github.com/scaron/prettyphoto)
- fully customisable through the plugins settings page
- configurable ‘hook’ attribute tag, support for HTML5 compliant ‘data-’ attribute
- option to automatically transform built-in WordPress galleries (linked to images) into prettyPhoto slideshows
You can download the latest version of the plugin from the WordPress plugin directory: