Lightbox 2.7.8 plugin for WordPress
Update: Reverted back to version 2.7.5 code, as ‘bugfixes’ introduced more bugs!
Get the latest version here . Click a thumbnail pic to see it in action. Learn more about this plugin.
Note to existing users: Auto-lightboxing of image-links is now enabled by default. lightbox-auto is no longer necessary.
Lightbox 2 allows you to present images in a slick window, while darkening the rest of the page. It makes your site look professional, and adds very little to page load times. It does not require any browser plugins to work, and works on just about every web browser out there! When a browser doesn’t support javascript, your web site still looks and works fine.
The brilliant Lightbox 2.2 javascript/css was written by Lokesh Dhakar . I simply made it into a WordPress plugin and added some options. Props to my man Krembo99 for initially enabling auto-lightboxing of links to images. The mighty Tanin improved thing further with his code wizardry. Thanks to both, your help is much appreciated!
To install: Put the lightbox-2 folder in your WordPress plugins folder, then activate it in WordPress.
Implementing Lightbox is now automatic . Create a link to an image to see Lightbox-2 work.
Features:
- Auto-lightboxing of all links to images in your posts. No more manually adding rel= to your links! This can be turned off in Lightbox 2 admin options. Also, no double rel= tags, thanks to Tanin.
- Grabs the title from the img title or the alt if there is no anchor title.
- Themes that determine the colours of the lightbox window. You can select from Black, White or Grey.
- No longer conflicts with any WordPress themes! This means it looks right, every time. Unless you are using a theme called stimuli_lightbox… ;)
- Uses wp_enqueue_script to prevent multiple prototype and scriptaculous libraries from clobbering each other. At least with other plugins that use wp_enqueue_script.
- This version works when wordpress is installed in non-standard locations , ie: /wordpress/ instead of /, whereas other Lightbox plugins break.
- Uses the arrow keys as well as P and N keys to navigate between images. The X and Escape keys close the Lightbox window, as does clicking anywhere outside the image.
- Minor cosmetic changes from the scripts by Lokesh.
YES, I will be adding WP 2.5+ ‘gallery’ lightboxing functionality in the future… not very soon, however!
Please read the Frequently Asked Questions included with the plugin before posting a comment!
About this entry
You’re currently reading “Lightbox 2.7.8 plugin for WordPress,” an entry on stimuli.ca
- Published:
- 09.07.08 / 10pm
- Category:
- News



I just upgraded to 2.7.8 – images are not displaying within the lightbox properly in safari 3.1.2. (displaying very small images in a correctly-sized lightbox). It works fine in firefox 3.0.1, though. perhaps the revert to the old 2.7.5 code threw out the safari fixes? HELP! thanks.
also displaying images too large (‘spilling’ out of the box). i’ll be reactivating 2.7.7 until a fix comes. thanks so much for providing this great plugin, though.
It still doesn’t work by the way… text-linked images are still opened in a new window, though the actual WordPress is “shaded”…
I’m seeing the same Safari issues as described above. I’m also dropping back to 2.7.7…
Thanks for the excellent plugin – looking forward to a new version that includes the Safari fixes.
Is there any chance you can integrate the “size image to fit in window width/height” fix that someone provided a while back?
That seems like such an obvious feature – I’d love to be able to show photos in a higher resolution without worry that people will have to scroll.
- Jeff
Upgraded to 2.6.2 — lighbox functionality is patchy, working for my NextGen Gallery pics but not ordinary images. It seems like it starts to open the box, but then reverts to the full image display in the browser.
ceti: read the FAQ!!! :D
Thanks for your work! In my opinion we will switch from our curret version to your plugin.
Kind regards
Marc
hi there,
next to lightbox, I have some flash embedded in my header and I also use the wp_flashtitles-plug in and the nextgen-gallery widget.
when I click on an image to enlarge it, the lightbox-effect starts, but the flash stuff located behind is “flashing” through the background created by lightbox and sometimes even stays on top. seems to be a z-index-issue..
is there a workaround for that?
btw. I am using Firefox 3 (latest) on Max OSX10.5.4
thanks for answers
steve
I can report the same like Sven. Running two blogs on wordpress and lightbox is unable to open text linked images. It opens the image in new or the same windows and wordpress blog became shaded, you have to click inside your blog to ramove the shade. Small bug but i did not find out how it could be solved :-(
I read you guys loud and clear. I’ll get on it. Steve: google ‘flash overlay’
Thanks for this great plugin! Unfortunatelly v2.7.8 seems to have an incompatibility with Cooliris WP PicLens Slideshow Widget 1.0.5. When the PicLens widget is placed in the sidebar, the “Next/Previous buttons” of the lightbox popup are not working properly any longer for articles containing several pictures: It freezes on the “load” icon.
If you would like to access my private test website to investigate, please let me know.
Regarding my comment above: here is an entry in the developper forum of PicLens plugin related to this exact problem. It seems to be a general “lightbox” issue:
http://liferain.com/downloads/forums/wp-piclens-plus/wp-piclens-plus-1053-and-nextgen-82-issueproblem/page-1/
First of all – THANKS A LOT! I love the plug-in! It’s super great and it really gives the page the last twist of great design and functionality.
However, I’m really bothered by the fact that pics viewed in Lightbox, is placed _under_ youtube videos. [e.g. http://aoos.dk/2008/09/den-sorte-skole-blood-on-santas-claws/ ]
Is this a problem you will be able to fix? I would reeeeally appreciate it.
Sincerly,
AoOs
Update: The problem is only in Firefox apparently ?
Serious bug on windows platform (2K3 exactly) and path.
Backslashes aren’t kept, so plugin can’t work properly.
Please consider this fix :
if (DIRECTORY_SEPARATOR==’/')
$absolute_path = dirname(__FILE__);
else
$absolute_path = str_replace(‘\\’, ‘/’, dirname(__FILE__));
I’m seeing the same problem with 2.7.8 and Safari – the box and the the image sizes don’t match. I’ve reverted to 2.7.7
Still lovin the plugin though – keep up the good work.
great plug in but there is one problem. i’m sure someone mentioned this already but any URL image link with a target=”_blank” will darken the whole website with a new browser window opening. is there anyway to fix that at this time?
Hey Rupert, awesome Plugin!
one issue, Quicktime Movies are to be over the Lightbox Layer. How can I get them behind the Lightbox. Or how can I get them in the Lightbox!
Happy traveling
Kugelblitz:
http://www.sitepoint.com/forums/showpost.php?p=3164991&postcount=44
Synergy: I’ll look into this.
Fabulous plugin first of all! I can also vouch for experiencing the target=”_blank” problem after trying to figure out what I was doing wrong (this wasn’t an issue in earlier versions). But it’s not a big deal since typically the reason for the blank target was for something like offering the image as a download which can easily be done from the floating window… Great work!
…and it seems not to work unless the link tag starts with title=”Image title”, followed by rel=”lightbox”
oups… I wrote the msg for the version 2.7.7, but I use the latest one: 2.7.8
I rewrite the msg:
Thanks for the script !
I have unfortunately a problem : I use the wordpress theme The Morning After (very slightly modified) and it provoks a bug with the lightbox plugin : the close button does not work (when moving the mouse on it, no link appears).
But clicking outside the box and pressing x both work for closing lightbox. And the prev and next links work perfectly.
I tested with other theme (such as the standard one) and I have no problem
Any idea ?
Thanks in advance !!
The Morning After: http://code.google.com/p/the-morning-after/
I got into the same bug as taaron and Alan, actually the width used for images is always the one of the first image that was displayed through lightbox (this can be observed in the generated source in <img id=’stimuli_lightboxImage’…)
I solved this using a quick hack (no time to track down the bug right now) after line 405 of lightbox.js I added the correct width to the element :
405: myLightbox.resizeImageContainer(imgPreloader.width, imgPreloader.height);
406: Element.setWidth(‘stimuli_lightboxImage’, imgPreloader.width);
This broke lightbox for the entire website in all my browsers IE, Firefox and Chrome. What a HORRIBLE release. I’m never upgrading this again.
Franck:
Your hack worked like a charm for me.
Thanks a lot! (^_^)/
I upgraded and everything broke – so I had to find a older version and go through the lightbox auto routine – cam you make the last version available? And also – I would like to get rid of the white line that appears on mouseover. Where in the code is that?
First off, I love this plugin, however, Installed the latest version of Lighbox and now it doesn’t work at all! The “rel” img tag is there, with the correct coding lightbox[%Gallery Name%] to work with NextGen Gallery, but nothing! Was working fine before… any help would be appreciated.
Thanks!
OK, fixed it by removing the WP Shopping Cart application… sorry for that! I’ll have to look into that to see what’s up :)
THanks.
Hello,
after I updated, some images is not opening…
You can see the bug here:
http://www.vamoss.com.br/blogfolio/?cat=6
The firt post and the thirdnot work, but the second and last works.
What can be happening?
THANKS!
Hi Rupert, I had this plugin working last week and suddenly it stopped. I can’t find “wp_header()” in my theme’s header – or in the default WP theme header either. But I do find this snippet of code:
in my header. So I’m thinking that Lightbox-2 should be working. I turned off all of the other plugins and it still didn’t work. Any suggestions? I love this plugin – and I can’t change themes. Thanks.
I am having a similar issue where lightbox starts to load up, and then it just loads the image by itself in the window.
Using 2.7.8. The weird thing is that it is just now happening today. The lightbox effect works normally on posts before today, and as far as I can tell, the HTML is still the same.
I just installed Lightbox 2.7.8 on wordpress 2.6.2. At first everything is working fine, but somehow the images in a certain post that I just posted today doesn’t. (while others are still working). Any ideas?
I upgraded the plugin the other day and it has ceased working on all images. was working fine before then. Any ideas on what changed in the code to make it stop working? thanks, and great plugin (when it works ;p)
problem with this version
first image in the post opens without lightbox,
second and the rest opens normal with lightbox.
its crazy one. any body know what to do ?
Just installed it and it worked an absolute charm. Love your work!
hi, the plugin stops working if Contact Form 7 plugin (http://ideasilo.wordpress.com/) is installed.
otherwise, great plugin
hi again, apologies for the above.
This plugin does work with Contact Form 7 but NOT if WP Shopping Cart (http://www.instinct.co.nz/e-commerce/) is installed at the same time.
My bad.
Hi, I installed the slickr gallery on a test version of a client’s site within a subdomain on the server. Once the site was complete I followed the WordPress guide on how to move your site to a different location on your server. Everything worked fine except now slickr is not working. It says the page has been moved…
woops I was meant to post this in the slickr comments…sorry!
Hi Rupert,
Can I have your email address? I’d like to ask some questions after I read your artschool review about BCIT.
thanks