WordPress.org

Ready to get started?Download WordPress

Plugin Directory

WP jQuery Lightbox

A drop-in replacement for Lightbox 2 and similar plugins, shedding the bulk of Prototype and Scriptaculous. Improved for mobile devices.

Trouble shooting:

If you have problems with WP jQuery Lightbox, please make sure you try these steps before asking for help. If you ask for help and I find any of these steps would fix the problem, I will just link you back here to do the work yourself.

  1. Make sure your site is not throwing any javascript errors. Use your browsers javascript console to find out.

If you're running a custom theme:

  1. Make sure you have wp_head(); just before the closing </head> tag of your theme, or you will break many plugins, which generally use this hook to reference JavaScript files.

  2. For the same reason, always have wp_footer(); just before the closing </body> tag of your theme.

  3. Many JavaScript optimizers, combiners, minifiers, etc. conflict with wp_localize_script, used to configure this plugin and many others.

  • If you have problems with jQuery Lightbox; first disable all JavaScript-optimizing plugins. (Optimize Scripts, W3 Total Cache, WP Minify etc)

  • If you develop JavaScript optimizers for WordPress, please play nice with the default API...

  • More info about this issue

Lastly:

  1. Disable all other plugins, one at a time. Try the lightbox between each.

  2. Revert to the default theme. Did it help? Fix your theme.

  3. Search the forums for similar symptoms.

Still have problems? Post a link and describe what issue you're having, and tell us what of these steps you've already tried.

Can the lightbox display the image description instead of the title?

WP jQuery Lightbox grabs texts from three different HTML nodes;

  1. title-attribute of link-to-image
  2. img tag's title attribute (if 1 is empty)
  3. img tag's alt attribute (if 1 and 2 is empty)
  4. HTML content of .gallery-caption or .wp-caption-text (in that order)

Look at how the default TwentyTwelve theme uses these in its galleries and set up your theme so it outputs what you need in these places.

I can see elements of my site through the overlay

It's a problem of z-index. Check the z-index property for the problematic elements, and force them to be less than 100. (Thanks dway!)

How do I add images to a post?

Inserting Images into Posts and Pages

How do I create a thumbnail gallery?

Upload images to a post (see previous question) and use WordPress' built-in gallery shortcode: [gallery link="file"]

Note the link="file" - this is crucial! By default the gallery will link your humbnails to a page displaying your image. With link="file" the thumbnails links directly to the image files - allowing Lightbox to function.

Must fade-in and animation of all *box-scripts be so slow?

WP-jQuery Lightbox lets you configure the animation duration and disable image resizing from the admin panel. Set duration to 0 to disable animations entirely.

For developers:

  1. Always have wp_footer(); just before the closing </body> tag of your theme, or you will break many plugins, which generally use this hook to reference JavaScript files.
  2. Apply lightbox to any content by running jqlb_apply_lightbox($your_content, "any ID"); It returns a string with all image links lightboxed, grouped by "any id".
  3. Many JavaScript optimizers, combiners, minifiers, etc. conflict with wp_localize_script, used to configure this plugin and many others.
  • If you have problems with jQuery Lightbox; first disable all JavaScript-optimizing plugins. (Optimize Scripts, W3 Total Cache, WP Minify etc)
  • If you develop JavaScript optimizers for WordPress, please play nice with the default API...
  • More info about this issue

Can I help you in any way?

Indeed you can!

Translations and help with implementing them would be nice. A read through and comments on my WordPress API usage would also be most welcome, as I'm not really able to keep on top of the frequent WordPress releases anymore.

And of course; a book or two always brightens my day! (used ones are fine!)

Requires: 3.5.1 or higher
Compatible up to: 3.5.2
Last Updated: 2013-6-9
Downloads: 361,183

Ratings

4 stars
4.3 out of 5 stars

Support

0 of 4 support threads in the last two months have been resolved.

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

100,1,1
100,1,1
100,5,5
100,3,3
88,8,7 100,1,1 100,2,2 88,8,7
0,1,0
70,10,7
100,1,1 75,4,3 0,1,0
50,2,1 50,8,4 67,6,4
83,6,5 100,3,3
100,2,2
94,18,17
100,3,3 100,2,2 100,1,1
100,2,2 100,2,2 93,14,13
100,11,11
67,3,2
88,8,7
71,7,5 100,1,1
78,9,7
100,2,2 100,1,1 67,9,6 80,5,4
100,2,2
60,10,6
75,4,3
100,2,2
67,3,2
100,1,1
100,1,1