Lightbox 2.7.7 plugin for Wordpress
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. Eric Strathmeyer squashed some major bugs. Thanks everyone who pitched in, 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.
Please read the Frequently Asked Questions included with the plugin before posting a comment!



This plugin is great I am sure, but there is still an issue between it and using fotobook. Mine darkens the page and opens the photo in a separate window. I have to use the slimbox plugin 1.2 now because it works.
Thanks
Hello,
First of all, thank you for the great plugin! But I have the folloing problem :(
I use Lightbox for showing images in bigger size. But when clicked, they can’t override the flash advert. Can you help me, how can I do that?
See the link: http://i.spodeli.info/uploads/1118565ab4.jpg
Thank you in advance!
Hi, I will check out this new package. I just modified the previous vesion to auto-resize pictures to fit the browser window…
I might take some time working this one out the same way, but I cannot promess it to be fast. Feel free to contact me about it, I could give a little hand.
It took a while to figure it out, since I merged another non-themed version of LB into the themed one. Images are in the .js, not in the seperate .css. I might manage to get it done, but not yet,…
credits already go to Fabian on the following page:
http://blog.hma-info.de/2008/04/09/latest-lightbox-v2-with-automatic-resizing/
and the therein mentioned Sebastien Grosjean for the original resizing patch (I didn’t look for his credits though)
Cheers!
Version 2.7.5 functions without problems. With version 2.7.7 I can open the first picture, but no arrows appear, for forwards and back. The close button is to be seen. Which is also missing, is the line, where for example stands “Image. 1 of 3″.
Hi, I’ve posted a question about overriding flash adverts, but the message’s missing, what’s the problem? :(
Urgixgax: read the FAQ.
Alexander: I don’t want new comments in the old post, so I disabled comments on the older post. I re-enabled them, so they are visible again.
Well, I guess I should post my query again, as far as I understand. Sorry to be so “impertinent”. The problem is, I wonder if there’s a way for Lightbox to override flash adverts, that I’ve placed in the side menu. See the pic: http://i.spodeli.info/uploads/1118565ab4.jpg Thanks in advance!
Please Rupert, can you tell me how to ask a question after all :( I post two times, but both deleted. My Q is not in the FAQ. Give me a link, if you wish… :(
Alexander: sorry, Akismet thought your comments were spam.
http://blog.deconcept.com/swfobject/forum/discussion/84/flash-lightbox-display-priority/
This plugin generally works great for me… I’m a developer and use it on about 15 sites. Thanks for your hard work. However, on my wife’s blog I have a small recurring issue that causes Lightbox to break.
On my wife’s scrap booking blog, one nice older woman who is a very frequent commenter consistently includes an @ sign in the URL of her Blogspot website. Each time she posts a comment with that invalid URL, the lightbox effect stops working in Internet Explorer 7 (but not Firefox). At first, those comments broke the effect site wide because the blog has a “top commenters” widget in the sidebar, which was adding the invalid link to every page. The top commenters widget is now configured so that it won’t list a commenter if the her URL includes an @ sign, so the effect now only breaks on those pages where an offending comment appears.
I’ve looked for a comment validation plugin, but the ones I’ve found only validate the syntax of the email address. So, every time my wife gets a new comment from this particular commenter, she immediately edits the comment to remove the @ sign in the URL to restore lightbox functionality on the page for that particular post. So far, my wife hasn’t wanted to write the commenter to inform her of her correct website address.
This is a minor and, for most sites anyway, rare issue. I just wanted to make you aware of the conflict, in case you might know of a simple way to avoid it.
Thanks.
alexander,
just upload your photos somewhere else, compare different places …
Thank you for the replies,
@ Rupert: As far as I can see, this would work for an embedded movie, while in my case it’s just a flash advert, and it is sent to my site by an affiliate program, that is, I don’t have the flash itself, but just a code I place (like the google adsense code) :( And that wouldn’t work…
@olli.vdl: Do you mean that i have to put the photos at a different location in my posts? But that would be unsuitable, as the top location is the best location… and it’s just the place, that overlaps with the flash banner placed on the right.. semes there’s no solution :(
hi.
this plugin is awesome.. :)
in my blog,
lightbox works well in FF,
but not in IE7.
I can’t catch my theme’s fault..
please help me ;)
Hi… I noticed that this script seems to have a bug… I use it with the latest Wordpress version, and even though all pictures are linked the same way (they’re on tinypic.com), some are opened in Lightbox and some in a new window….?
I want to have text links spawn lightbox image popups. But the plugin only will work with image thumbnails as the link.
Text links will kinda work, but only if there’s an image version on the page.
Is it possible to have text links spawn my lightbox image pop-ups: example Choice-One, Choice-Two, Choice-Three.
hello, ive probleme too.
When i’m watching a picture with lightbox, my embed videos come in foreground and lightbox in background
What can i do for this, thanks
kchris: sorry mate, don’t have time, and I’m not familiar with IE7 and its quirks.
Sven: read the FAQ.
Adri3n: I answered this already in a previous comment.
kenny: good catch! I’ll debug…
@Alexander
My suggestion was to move your picture files onto another server that doesn’t want to load annoying Flash stuff.
So no Spodelli, something else like imageshack, or so, I don’t know these places, since I don’t need them. Hope this is useful…
The FAQ don’t describe the problem that it works just halfway…
ah, kenny’s problem might be mine… nevermind then…
Sven: Ahhh. Usually, and I mean 99.999% of the time, the issues people have are a result of a) plugin conflicts or b) theme conflicts. In either case, there’s little I can do.
Indeed, but if there was a plugin and/or theme conflict, it would never work.
Instead of sometimes.
But the “text link” thing seems to fit here.. :)
I have exactly the same problem than George with the Fotobook wordpress plugin. Each time an update of lightbox is released, I install and test it, but it doesn’t work. So I eventually revert back to version 2.2.2; this one works properly.
I am using Wordpress 2.5.1 and the latest version of Fotobook.
Seems to clobber my jQuery call to
$(document).ready() = function{blah blah blah};Okay, that’s not the EXACT syntax… but you know what I mean.
Does Lightbox work with Wordpress 2.6?
Looks like Lightbox 2.7.7 does not work with AJAXed Wordpress 1.21 under Wordpress 2.6
Hi,
I am using WP2.2.1 and activated lightbox-2 with checked auto box but no code will be added for lightbox.
2nd problem: I use to edit my posts offline with ecto. Which code and where I have to add to make lightbox work for me?
Thanks.
any way to make it load earlier? It takes a while until my page it loaded cause all images are on one page… and lightbox does not work until the page is fully loaded.
can I load it first and then the page?
PS. the Throbber looks strange.
1. Can I group pictures IN ONE PAGE into, say, Gallery 1, Gallery 2, etc., with 8 pics each for example, and keep lightbox from jumping to the next gallery automatically, thus forcing the viewer to close one group before moving to the next.
2. Will #1 (above) help in loading time? In another site, I have more than 300 pics in one page and, boy, is it slow to load.
3. Is there a way to start the slideshow by default once the first picture is open rather then clicking on the navigation arrows?
Note: I’m on WP2.5 with Lightbox 2.7.7
Sorry for the typos. . . question mark in #1 and “rather than” in #3. Sheez. . .
Hi. Tested your plugin, and it works like a charm – although, it breaks my site, and I can’t figure out why – as far as I can see, the only code added is the link to the chosen color-type CSS, and then the “rel-tag” to the images?
Although, I’m sure that Lightbox is the culprit, cause the page works fine if I just disable Lightbox.
The problem is that my footer, which should reside at the bottom of the page, is, when Lightbox is enabled, pushed up underneath the sidebars.
I do use some fancy CSS to actually make my floated columns work as intended, but I can’t really see where the clash is.
Maybe you can shed some light on this?
I’ve tested with IE 7, FF 3 and Opera 9.51, and they all behave alike.
Currently, the Lightbox-plugin is enabled, if you would like to have a look.
I have added Lightbox2 to my prototype Wordpress site. Here is a sample post where I am trying to display a gallery. http://www.equip2golf.com/wordpress/?p=99 Two questions … 1) how do I get the images to be linked together with the Next/Prev buttons. Mine are not showing up. I am only getting a single image. and 2) how do I get the set of images to launch fro the post page.
Thanks for a wonderful application.
Gary Mayes
Hey got another question.
I got some Quicktime movies on my page that overlay the Lightbox. How can I change the Layer?
Thanks thanks for this wonderful plugin! The auto-lightboxing saves tons and tons of time.
I’ve got a weird issue though… in certain image sets, one image will just refuse to load. The lightbox overlay will appear, the throbber will appear, and nothing will load. The backwards and forwards functions are also broken if there is one of these refused images. I’m wondering if it’s something about how I’ve named the images, or the posts… everything else works just fine. Has anyone had this effect?
I’ve linked to one of the broken image series if you want to see what I mean. Thanks for any input, and thanks again for the hard work on the great plugin!
Please make it xhtml valid ;-)
Hi,
First let me thank you for your excellent work :)
I wanted the images on my blog pages to NOT be grouped together (with rel=”lightbox[xx]“) automatically so I did a little hack:
Line 55 in lighbox2.php i changed from
$replacement[0] = ‘ID.’]”>’;
to
$replacement[0] = ‘‘;
It might be usefull if this could be done through an option on the Settings > Lightbox 2 page… something like ‘Keep images seperated’ and ‘Group all images’ …
Good luck with development of this plugin!
works great! Only a little problem: when I’m using it with QuickTime Embedding Plugin ( http://www.mobvcasting.com/wp/?p=118 ) in the same page, the quicktime appears in a layer over the image of the lightbox… do you know how can I fix it??
Example:
http://obsolet.com.es/wp-content/uploads/2008/08/imagen-1.png
Will you be adding automatic lightbox for galleries anytime in the near future? Thanks for a great plugin!
First, this is a fantastic plugin. Tremendous and professional!
I was just wondering if it were possible to have the default wordpress gallery display the pictures via Lightroom with the next/previous buttons. I really like the ease of the built-in gallery but would love to implement Lightroom even more.
Thanks!
Works really well, but the one thing I can’t find is where to configure it. You mention configuring certain settings, but yet I see no where that can be done. I am using Wordpress 2.5.
Good Morning, I love the plugin however – I do have one request/inquiry. Can you please replicate this plugin using the mootools framework?
I had a quick question, my close x btn does not work. It puts a # at the end my url? Anyone else getting this error?
Thanks!!!
First of all, thanks for an AWESOME plugin. It’s become soooo much nicer, now that you don’t have to include the “rel=” manually.
Anyhow, I do have some trouble with the plugin.
http://aoos.dk/2008/08/tyske-ol-skinker/ – Here e.g.
Why is it that the two pics on the right doesn’t open in lightbox, but the two on the left do? The code is the exact same…
Looking forward to you answer, this is really bothering me.
//AoOs
Hello , I have a question , Does lightbox work with wordpress 2.6.1 , if not are there any modifications to the code to make it work ?
Your plugin is the only decent lightbox plugin out there for wordpress atm.
Thanks
Hi,
In the following:
sql_large_cam1.jpg is updated every two minutes.
sql_small_cam1.jpg is refereshed when the brower is refreshed.
The problem is that lightbox always shows the version of sql_large_cam1.jpg that it showed the first time it was used. That is, lightbox does not show a new version of that image even though it exists. It seems like there’s a cache somewhere that needs to be refreshed?
This happens at least with IE7
Looks like the html was not displayed.
Here’s another try with GT and LT instead of the angle brackets:
LT a href=”sql_large_cam1.jpg” rel=”lightbox[sql]” title=”Cam1″GT LTmg src=”sql_small_cam1.jpg” border=”1″ align=”center” alt=”SQL cam1″GT LT/aGT
Hi, first of all thank you for this wonderful plug-in!
Anyway, I have a problem with it, and I really don’t know what to do: it works only with the “Preview” mode.
I’ve the 2.7.7 version installed on my Wordpress (2.6) blog, with Atahualpa 2.01 theme.
I’ve used it with the “auto-lightbox” option activated to compose a post, and all worked great in “preview” mode. But when I’ve published the post, all lightbox effects disappeared.
What’s wrong? Could you help me?
Thank you in advance for your attention.
Awesome!! 5 minute install, working like a charm!
Do you have a Paypal donation link?
Thanks for such a great plugin.
Thanks for sharing you coding abilities with those of us who have remarkably less – your plug-in is greatly appreciated.
I recently updated to the latest version of WP (2.6.1) and noticed afterward that the images were no longer using the Lightbox to display. Admittedly I haven’t checked in awhile, but last time I used the site they worked fine. I went through your Faq to make sure it wasn’t anything listed.
Check out the following as an example of what is meant to use the Lightbox: http://spireintegrated.com/blog/?p=16
It is a tweaked theme, but I pretty much only changed the graphics and added some code for the category images to work. I am using the rel=”lightbox[group]” property in the code, just to make sure of image grouping – could this be causing problems?
Thanks again!
First of all, thank you for this great plugin. You really have serious skills :D
i have the same problem than Jason. I can see that the plugin is working by peeking on the HTML code but it is not displaying the image, it is just one more link…
i’m on WP 2.6.1 and the newest release of lightbox.
Thanx in advance.
Hi,
First: thanks for this plugin, it rocks.
1 issue, I have some gaint pictures (link: http://kristofmattei.be/2008/08/05/zoo-van-antwerpen/ ).
Is there a way, that when you click the image, it only opens to match the screen? And then another click opens it fully?
Regards,
Kristof
Hi,
I’ve installed the lightbox version 2.7.7 on my WP 2.6.1. Nearly everything works fine, thanks a lot for the great plugin. I have one question about the plugin: Is it possible, to change the size of the shown pictures or to disable the auto fit option? On my blog the pictures will be shown too large.
Thanks for your help in advance!
Kind Regards,
Wolfgang
This is a great plugin. Thanks for making it. Do you have any plans to incorporate the [gallery] function from Wordpress? That would be a great final addition to finish off the plugin. Keep up the good work
@ Wolfgang (“disable the auto fit option”)
Do you mean there is a way to enable the auto-fit? Then I have no work to do…
One can cahnge the picture sizes to be more appropriate to view, saves bandwidth.
And One can add a link to a bigger image in his site as a workaround
Also one can wait untill I merge som automatic resize (I will be hosting it, as there is no response from here to motivate me to do it faster then I want it to. I mainly want it for myself… So I will do it, could be soon…
@ Kristof: I am going to fix it… soon …
I did an automatic update from within the admin to version 2.7.7 and now all of my image links have stopped working correctly (IE8 and Firefox3). With over 400o of this type of link, this is a potential disaster for me.
Also, is there a way that I can change back to the last version, which workred wonderfully.
BTW, I forgot to thank you in my previous post for providing this great plugin. I appreciate it.
Great Plugin – exactly what I was looking for.! I have one question: I loaded it into my site and it works great on the static pages, but doesn’t work on posts. Can you shed any light?
anyway to get this to work with [gallery]?
for people who want this to work with the [gallery] shortcode. Use this plugin:
http://justintadlock.com/archives/2008/04/13/cleaner-wordpress-gallery-plugin
It works perfect “out-of-box” and required no setup to get [gallery] to lightbox properly.
This plug-in is great! An auto-fit-to-screen-size option would make it perfect (tried using Ollie’s version but doesn’t work here..).
Cheers!
Lazare
Ok…. so i installed the plugin and let it do its thing…. but it didnt do anything… So before I start messing around with the rest of my plugins, I have a question, oh and I do have wp_header. Anyways, the questions I had was about the insall/use of the plugin. I just need to activate it and click on the little “Let the plugin add necessary html to image links”. For the image link, does it just require the tag? Then its supposed to take care of the rest right?? While I am waiting for a respose, I guess I might as well take a look at my plugins, and see if thats an issue, but I was just wondering that as this is like the third or fourth plugin I tried that does the same effect, and none of them work so far. All it does when I click on an image, even if there is an rel=”lightbox” tag in it, it just opens the root folder of the plugin – I get this in both IE7 and FF3.
)=
I was VERY happy with your template until it stopped working this morning. I updated to Lightbox 2.7.8 and WP 2.6.2.
Please tell me what I should do!!
Thanks!
you could try reverting to a previous version: disable the plugin, remove it from the folder, and put in the older version. Don’t know where to download it though, probably here somewhere…
Thanks for the cool plugin!
I think I found the same bug that kenny@08.07.08 / 8am reported..
If I have a text-only photo link in the page, it seems to kill the lightbox to open images as supposed, instead images are opened as one would expect – straight link to the image with no effects.
I was able to track this down putting a imagelink in the beginning and text link (to an different image) in the end and then changing the position of the -tag. When the links were on the same page, the image link didn’t work (and the text link didn’t work at all, no matter what. Though I didn’t try to add a thumbnail link on the same page to the same image, according to what kenny reported, it should have helped)
You can contact me rhk /at\ iki /dot\ fi
Well tested it and my experience is that if you have a text link to an image, lightbox can’t show any of the images as supposed.
hello, first of all I just wanted to say thank you for such a great plugin. It works absolutely great! THANKS!
Quick question for you and I apologize if this is answered somewhere else but I could not find it on any of the forums:
Is it possible to hide the img title or the alt title so that only the number in the gallery is displayed when the lightbox is activated? I typically don’t rename each of my photos so I just wanted it be blank.
I tried looking for the code but I don’t know which part I need to eliminate in order to hide the field. Thanks again.
Lee
I
So now all that’s left is to make it work properly for medium-sized images linking to their fullsize version, not just thumbnails.
Otherwise: amazing!
Doesn’t work on my site:
http://masonsklut.com
Why?
The title of the tag is the caption of the image in the lightbox. I want the caption to be a link. Can I put an tag in the attribute of an tag?
Hi firstly thanks for the great script :-)
One quick question, i had to migrate a site to a new server, i used the wordpress export import feature. All is well, except the effect no longer works on existing posts.
I know the script is ok, as any news posts work alright. Is there any way to getting it working again for existing posts in this scenerio?
Thanks
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.
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 have to acknowledge what a fantastic plug-in lightbox is.
much appreciation
Hi there. I had gotten this error coming from my blog…
“Fatal error: Call to undefined function: wp_enqueue_script() in /home/chrisha2/public_html/blog/wp-content/plugins/lightbox-2/lightbox2.php on line 67″
I have ensured and gone through the three items on the FAQ, with no resolution. Other themes showed the same error, deactivating all plugins did not change anything.
Sorry, not to savvy on the scripts, otherwise I’d probably figure this one out on my own. I have left it up on my site…not sure what to do next. Thanks for your time.
hi there!
i have problems with lightbox since the update to 2.2.7.8 even with standard wp-kubrik-theme. linked files will be shown “normal” in the blog window (only image), not in the lightbox-layer.
after a downgrade to version 2.2.7.7 everything was fine again.
anyone else with this bug?
cheers, paul
Hello I report bug on your plugin on wordpress 2.62 version
Warning: call_user_func_array() [function.call-user-func-array]: First argumented is expected to be a valid callback, ‘wp_lightboxJS_add_quicktag’ was given in /mnt/140/sdc/d/e/olivierbaudrydesign/wp-includes/plugin.php on line 311
This was working great on my site until I installed ViralInviter, which has a pop up similar to Lightbox. The ViralInviter works fine, but now images don’t open in a Lightbox. Can anyone shed a light on this? Visit ratemybistro.co.uk and click the Invite a Friend link to ViralInviter working, but then click an image on the posts and you’ll see they don’t open in lightbox anymore.. But when I remove ViralInviter code, it works.. and vice versa.. Arrrgh!!
Looking at the folder structure and php files, I can see that ViralInviter uses Lightbox.css and lightbox.js .. Hope this helps you come up with a solution.
I’ve had to turn your plugin back on because my visitors are asking where the popups have gone.. but now the viralinviter doesn’t open in a popup… Is there a way to fix this?
I assume this doesn’t get read anymore? It’s always nice to see people develop something and then sit back and do nothing when a legitimate question is asked in relation to a serious compatibility issue.
Hi there, love the plug-in, thank you for you hard work on it and making it available to all of us.
I was wondering if there is a work-around or update on the text link issue that a couple previous users mentioned. This would be a great feature to an already great tool.
Thanks again.
New version fixes the link issues, Safari issues, etc.
RatemyBistro: Sounds like a plugin conflict. Contact the author(s) and ask them to use wp_enqueue_script(). My plugin ‘plays nice’ with others… reverse is not necessarily true.
Hiya, i have seen your site when searching a few weeks ago and i really love the design! I just bought a new 3 character domain (cost me a packet) for a niche review blog, and i was wondering if your design is a free or paid one? I’m new to Wordpress and about to set it up, and i would really like to get something with a similar look to yours. Any ideas where i could download or buy something similar? Thanks for your help! :)
rp said:
I had a quick question, my close x btn does not work. It puts a # at the end my url? Anyone else getting this error?
Thanks!!!
-
I am having the same exact problem. I think this plugin is a godsend. if only I could get this to work. I have a lot of older people visit my site so I need it to be very clear and consise
After a reinstall my close button doesn’t show that it is a linked button. the cursor just grazes over it as if the close button didn’t exist. any help would be great
wp-scriptaculous is really a smart and speed framework! i love this stuff.