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.

  1. Upload the wp-jquery-lightbox-folder to the /wp-content/plugins/ directory
  2. Activate the plugin through the 'Plugins' menu in WordPress
  3. Check out the jQuery Lightbox-panel in your admin interface for usage details and configuration.

How to Use:

  1. With WordPress built-in gallery: [gallery link="file"]
  2. All galleries in a post make a single slideshow. To create separate slideshows, use group:

    [gallery link="file" ids="1,2,3" group="mon"]

    [gallery link="file" ids="4,5,6" group="tue"]

  3. You can manually add a rel="lightbox" attribute to any link:

    <a href="image-1.jpg" rel="lightbox" title="my caption">image #1</a>

    Note the use of title-attribute to set a caption

  4. To manually group sets of related images, follow step 3 but additionally include a group name in the rel attribute:

    <a href="image-1.jpg" rel="lightbox[roadtrip]">image #1</a>

    <a href="image-2.jpg" rel="lightbox[roadtrip]">image #2</a>

    <a href="image-3.jpg" rel="lightbox[roadtrip]">image #3</a>

  5. You can use the data-download attribute to set a custom download link:

    <a href="image-medium.jpg" rel="lightbox" data-download="image-superlarge.jpg"> [...] </a>

  6. To disable lightboxing of an image link, just set any other rel-attribute: rel="nobox"

  7. Keyboard support: Arrows, P(revious)/N(ext) and X/C/ESC for close. Swipe left / right on touch devices.

  8. Infinite-Scroll and similar "endless pages"-plugins should call doLightbox(); whenever it loads new content. Check your plugin for a setting named "callbacks" - code that is called after each new page is loaded. Add this line; if(typeof doLightBox !== 'undefined' && typeof jQuery !== 'undefined'){ doLightBox(); }

  9. On the server side you can apply lightbox to any content by running jqlb_apply_lightbox($your_html_content, "any ID"); It returns a string with all image links lightboxed, grouped by "any id".

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.

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

Ratings

4 stars
4.3 out of 5 stars

Support

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

Got something to say? Need help?

Compatibility

+
=
Not enough data

2 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
100,2,2