Simple Lightbox

The highly customizable lightbox for WordPress

Beta Time! Simple Lightbox 2.0 Beta is here.  Grab the latest version and start testing!

Simple Lightbox is a free plugin for WordPress that lets you add a very simple and customizable lightbox image viewer (Javascript-based popup image viewer) to your WordPress website.  It also supports themes to allow the best possible integration with your site’s theme.

Features

  • Supports links in Widgets (New)
  • Supports Image Attachment links
  • Display image metadata (caption, description, etc.) in lightbox
  • Automatically activate links (no manual coding required)
  • Keyboard Navigation
  • Link Validation (optional)
  • User-customizable skin (template) support
  • Enable Lightbox depending on Page Type (Home, Pages, Archive, etc.)
  • Group image links (play as a slideshow)
  • Group image links by Post (e.g. separate slideshow for each post on home page)
  • Group gallery links separately from the rest of the links in a post
  • UI/Animation Customization
  • Slideshow Customization
  • Backwards-compatibility with legacy lightbox links

Installation

  • Install and activate Simple Lightbox on your site (help)

Usage

  1. Insert links to images into your post (WordPress Documentation)

That’s it! The image will be displayed in a lightbox viewer automatically.

Need a bit more help? Simple Lightbox for Noobs: The Beginner’s Guide to Using SLB.

Notes

  • Images are displayed at their original size to maintain optimum image quality.  Resizing images to their desired display size prior to uploading is recommended.
  • You can manually add rel="slb_off" to any image links that you do not want to be displayed in a lightbox

Support

Found a bug or otherwise experiencing an issue with Simple Lightbox?  Report the issue here.

Details

Version:
1.6.3.1
License:
GPL v2

Requirements

  • WordPress 3.3.2+
    • SLB has the same minimum requirements as WordPress itself.
    • SLB requires the jQuery library officially included with WordPress.  If any other version is loaded (manually or by other plugins/themes), SLB may not function properly.
  • Verify that your site's theme uses the following template tags (standard in any professional theme)
    • wp_head()
    • wp_footer()
    • the_content()

Download

Version History

1.6.3.1

  • Fix: Backward compatibility restored (Backward Genius)

1.6.3

  • Optimize: Improved lightbox overlay display

1.6.2

  • Update: Rebuild JS code
  • Optimize: Improved compatibility with PHP 5+
  • Optimize: Improved utility code
  • Fix: Some elements can overlap lightbox
  • Fix: Slideshow not automatically starting (Laurence of Autoplay)

1.6.1

  • Optimize: Handle repeated initializations of lightbox on client-side
  • Fix: Localization not properly loaded (Mustafa Lingo)

1.6

  • Add: Widget support
  • Add: WordPress 3.3 support
  • Add: Localization support
  • Add: Option to group gallery links separately (supports WordPress & NextGen galleries)
  • Add: Upgrade notice
  • Optimize: WP 3.3 compatibility
  • Optimize: Improved compatibility with URI case-sensitivity
  • Optimize: Activation processing
  • Optimize: Image grouping
  • Optimize: Image metadata loading performance
  • Optimize: File loading
  • Optimize: Improved safeguards against interference by bugs in other plugins
  • Optimize: Link processing performance
  • Optimize: Lightbox styling isolated from site styles
  • Optimize: Improved link processing performance
  • Optimize: Improved image metadata support
  • Optimize: Improved support for HTTP/HTTPS requests
  • Fix: SLB is not defined in JS (Jezz Hands)
  • Fix: Boolean case-sensitivity (78 Truths)
  • Fix: YouTube embed using iFrame overlaps lightbox (Elena in Hiding)
  • Fix: Issue when scanning links without valid URLs (McCloskey Iteration)
  • Fix: Image activation is case-sensitive (Sensitive Tanya)
  • Fix: Visible lightbox overlay edges when image larger than browser window (Chibi Overlay)
  • Fix: Options availability for some users
  • Fix: Inconsistent loading of image metadata
  • Fix: Links not fully processed when group is set manually

1.5.6

  • Add: Display image description in lightbox (with HTML support)
  • Add: Support for W3 Total Cache plugin
  • Add: Initial support for NextGEN galleries
  • Update: Important: System Requirements aligned with WP 3.2.1
  • Optimize: Improved support for small images in default template
  • Optimize: Support for non-English text in user options
  • Optimize: Improved IE compatibility
  • Optimize: Improved data handling
  • Optimize: Skin loading performance
  • Optimize: Skin CSS Cleanup
  • Optimize: Caption support for galleries
  • Optimize: Options code cleanup (Juga Sweep)
  • Fix: User-defined UI text not used (Ivan gets Even (cooler))
  • Fix: Options reset after update (KRazy Donna)

1.5.5.1

  • Fix: Disabled links not being disabled (Disabling Sascha)

1.5.5

  • Add: Distinct link activation (will not affect other lightboxes)
  • Add: Backwards compatibility with legacy lightbox links (optional)
  • Add: Support for WordPress 3.2
  • Add: Support for links added after page load (e.g. via AJAX, etc.)
  • Add: Admin option to enable/disable attachment links
  • Add: Support for image attachment links
  • Update: Options management overhaul
  • Update: Additional WordPress 3.2 support (Gallery)
  • Update: Cache-management for enqueued files
  • Update: Improved UI consistency
  • Update: Improved compatibility for older versions of PHP
  • Update: Internal optimizations
  • Update: Improved URL handling
  • Fix: Improved options migration from old versions (Hutchison Migration)
  • Fix: XHTML Validation (Hajo Validation)

1.5.4

  • Add: Optional Link validation
  • Add: Keyboard Navigation
  • Add: Option to enable/disable image caption
  • Add: `rel` attribute supported again
  • Add: Use `slb_off` in link's `rel` attribute to disable automatic activation for link
  • Optimize: Filter double clicks
  • Optimize: Separate options to enable/disable SLB on Posts and Pages
  • Optimize: Better grouping support
  • Fix: HTTPS compatibility (Jürgen Protocol)
  • Fix: Enabling SLB on Pages issue
  • Fix: Zmanu is_single
  • Fix: Image order is sometimes incorrect

1.5.3

  • Update: Lightbox will not be activated for links that already have `rel` attribute set
  • Fix: Caption may not display under certain circumstances (Caption Erin)
  • Fix: Images not grouped when "separate by post" option is activated (Logical Ross)

1.5.2

  • Add: Option to use the image's URI as caption when link title not set (Under UI options)
  • Fix: Slideshow loops out of control (Mirage of Wallentin)
  • Fix: Lightbox fails when group by posts disabled (Lange Find)

1.5.1

  • Added: WP Gallery support
  • Fixed: Navigation hidden when only one image
  • Fixed: Use user-defined UI text

1.5

  • Add: Theme support
  • Optimize: Performance optimizations

1.4

  • Add: Close lightbox by clicking to left/right outside of image (an oft-requested feature)
  • Update: Integrated with jQuery
  • Optimize: Javascript filesize 9x smaller

1.3.2

  • Add: Option to enable/disable lightbox resizing animation (thanks Maria!)

1.3

  • Add: Customizable UI label text (close, next, and prev button images can be replaced in images directory)
  • Add: Group image links by Post (separate slideshow for each post)
  • Add: Reset settings link on plugin listings page
  • Optimize: Organized settings page  1.2.1 (2010-06-15)
  • Fix: Image title given higher precedence than Image alt (more compatible w/WP workflow)

1.2

  • Add: Option to group automatically activated links (for displaying as a slideshow)
  • Optimize: Lightbox caption retrieval

1.1

  • Add: Enable/disable lightbox functionality by page type (Home, Pages/Posts, Archive, etc.)
  • Add: Automatically activate lightbox functionality for image links
  • Add: Link to settings menu on plugin listing page
  • Optimize: Options menu field building
  • Optimize: Loading of default values for plugin options
  • Optimize: General code optimizations

1.0 (2010-05-29)

  • Initial Release

Credits/Acknowledgments

The lightbox functionality of this plugin was originally based on Lightbox Slideshow by Justin Barkhuff, but has undergone major changes as it entered puberty.

Discuss

654

mtwelve

January 23, 2012 12:39 am

Hello,

Thanks for the response.

I wrote the shortcode; no plugin.

Here it is: http://pastebin.com/C6HHqJEC

(: Thanks

Martin

January 24, 2012 11:58 am

Hi, great plugin! Is it possible to put html or an iframe into a lightbox instead of a picture? How would one go about that?

Thanks,

Grollaz

January 25, 2012 2:21 am

Hi, i use your simple lightbox and all is ok for all standard gallery, but i have a problem with dinamically generated tabs that include a gallery, the image is not opened in lightbox, What i can do?

I use the last wp 3.3.1 and the last plugin 1.6.1

Here the page with not working gallery:
http://www.meloda.it/immobili/vellezzo-bellini-via-aldo-moro/

Thanks.

Sol

January 26, 2012 1:11 pm

@Ken: Hmm, that is strange– adding the rel attribute to the image tag should not have any effect on the caption, though adding the text to the title attribute of the link should. The lightbox description currently supports images in post content.

@mtwelve: Interesting one. Your custom shortcode is stopping all filters hooked into the_content with a lower priority from processing the outer content. This is due to the nested the_content() calls. Incorporating the following code into your shortcode function should resolve your issue:

//Save variable state BEFORE entering nested loop
$filter_temp = $GLOBALS['wp_filter'];

/* ...nested loop... */

//Restore variable state AFTER exiting nested loop
$GLOBALS['wp_filter'] = $filter_temp;

@Martin: Additional content types (HTML, etc.) are planned for a future update.

@Grollaz: I’ve tested SLB with WordPress Post Tabs and gallery links displayed correctly in the lightbox. What are your settings for the tabs plugin? There may be a setting that is causing the conflict. Also, if you disable the tabs plugin, are the images on the page you provided displayed in the lightbox?

YeahWow

January 26, 2012 2:36 pm

Great plugin! My only problem is displaying very small images in the lightbox. For instance: an image with width 10 pixels will create a very small space for descriptions, prev & next label and so on. Isn’t it possible to have a minimum width of say 80 pixels, even if the image is smaller? Or can I change this by hand in the settings or in the source code?
Thanx!

mtwelve

January 27, 2012 5:57 am

Sol! Your a don!

I put the two lines at lines 8 and 59 and the subsequent lines moved down; http://pastebin.com/C6HHqJEC

It seems to work so I presume those locations are OK.

Without meaning to sound corny how did you know where to look? Any good suggestions for a gaining a more in depth knowledge of PHP?

Thanks again!

Sol

January 30, 2012 9:40 pm

@YeahWow: Good idea. I’ve added it to the list.

@mtwelve: It may sound overly simplistic, but the first thing I do when debugging is to determine exactly where the code breaks.

It can sometimes help to start out wide (what happens if I disable all other plugins?) and progressively zero in on the actual problem code (enable plugins until the issue presents itself, determine where in a specific plugin the code breaks, etc.)

Specifically for WordPress, it really helps to walk through the core code and learn what WordPress does. Knowing the order of events in a WordPress operation (e.g. displaying a blog post) can really help in quickly identifying where an issue is occurring.

In this case, it was clear that there was something stopping the filters hooked into the_content from fully running because the shortcodes were being processed, but SLB was not. From there, I walked through WP’s apply_filters() function to determine where nested loops (and thus nested filter calls) might cause an issue.

Kamil

February 1, 2012 2:56 am

Hi!

This plugin works great. Any chance we could have different skins implemented? :)

Also, I have a question. On my blog, I use this plugin to showcase image. But large ones are not resized? Is there a way to fix it? Adding some code or something? E.g. http://kurnikoff.com/2012/01/nme-club-koko-nightbus/

Kamil

jerome

February 1, 2012 8:05 am

Amazing plugin ! Thanks a lot

How disable keyboard for next and prev ?

ArtBIT

February 1, 2012 8:08 am

It seems that it doesn’t work with thumbnails that link to attachment pages, I was under the impression that it would.

Sol

February 1, 2012 9:07 am

@Kamil: SLB supports user-customizable skins. Here’s some information on designing skins & some information on registering skins for use in SLB.

Regarding image sizing, it is recommended that images are uploaded at the desired display size for optimized image quality and performance.

@jerome: Good point. An option to enable/disable keyboard control will be added in a future update.

@ArtBIT: Image attachment links are supported (as long as you have it enabled in the settings). Please see the “How to Report an Issue” section above to provide the information necessary for me to investigate the issue you’re experiencing.

niko

February 2, 2012 10:59 pm

It isnt working with custom post types! Can you add the option to settings please!

Theresa Sheridan

February 5, 2012 9:05 am

I’ve used this before with NextGen Gallery and it’s worked fine, however for some reason any images that have a description written in the NextGen Gallery will not display in the Lightbox. I’m stumped. I’ve tried deactivating the only other plugin that’s being used at this time, that did not change anything. The URL is http://tigerco.com/?page_id=95. How can I fix this? I have it functioning on another site, with dozens of other plugins activated and it is showing the captions fine.

Sol

February 8, 2012 3:02 pm

@niko: Custom post types are supported and is currently tied to the ‘Enable on Posts’ setting. If you have SLB enabled on posts but it is not working, please refer to the “How to Report an Issue” section above to provide the necessary information for your issue to be looked into.

@Theresa: That is indeed strange. SLB should display images in NextGen galleries regardless of whether they have a description. Unfortunately, the link you provided loads a maintenance page, so I am unable to look into your issue further. Let me know once there is an active link that I can look at and I’ll be glad to check it out.

Leave a comment

Please report issues and other support requests via Simple Lightbox's official support system.

Comments containing support requests will be deleted immediately.