Make FCG work with Lightbox.
10.07.09
nerd. //
Super, super nerd post. I apologize ahead of time to my non-web nerd friends that don’t want to read this crap. But it’s really helpful…
The Lightbox 2 plugin doesn’t work with the Featured Content Gallery plugin! Sounds like the end of the world doesn’t it? Well, I thought it was too. But it’s not. No one had the full answer on how to get these two plugins to be compatible with each other so I dug around and found out how to make it work. It’s really pretty simple.
The problem is that the scripts from both plugins don’t work together. And both plugins load all there scripts on the header. I only needed the Featured Content Gallery on the frontpage, and Lightbox everywhere else. I don’t need Lightbox for the homepage. So first, if you haven’t already, make multiple headers. If you don’t know how to do this, you should, it’s easy and very useful. Check out this blog article on how to make more than one header.
In the Featured Content Gallery plugin files find ‘/* Output $galleryscript as text for our web pages:’ and replace the small piece of code underneath is with this:
In the Lightbox 2 files open ‘lightbox.php’. On line 74 remove the line for (is_home). Or whichever pages you don’t need Lightbox to work on. I removed the (is_home) section and this is what that chunk of code looks like now:
Now the Featured Content Gallery works on the homepage (the only place I need it). And Lightbox 2 works everywhere else.
Success.


4 Comments
Add your own1. Jaq | October 8th, 2009 at 5:16 am
This was exactly what I needed. Thank you very much for your tutorial!!
2. NL | October 11th, 2009 at 9:30 pm
same here, my life is complete
3. Andrew | November 24th, 2009 at 8:10 am
i have been searching for this for some time now. problem is i am using the other Lightbox 2 (why there are 2 beats me) and the code in the lightbox.php file is just different. tried switching to the Lightbox 2 you used, but this broke every popup image link (and i have too many to redo).
any interesting in posting a solution for this other version of Lightbox 2 so it too works with FCG????
thanks,
Andrew
4. Ferpont | December 28th, 2009 at 12:36 pm
Dude!! you are super-genius!!! been strugglin’ for more than a month with this… you gave my life back to me!!!
Leave a Comment
Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>