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


  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: 385,327


4.2 out of 5 stars


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

Got something to say? Need help?


Not enough data

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

88,8,7 100,1,1 100,2,2 88,8,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,3,3 100,2,2 100,1,1
100,2,2 100,2,2 93,14,13
71,7,5 100,1,1
100,2,2 100,1,1 67,9,6 80,5,4