On my site the newest version of the Lightbox-plugin (2.0.2.) doesn’t work either in combination with the (just updated to 1.0.2.)NextGEN gallery. I’ve re-installed the good old 1.8.2. version of the Lightbox-plugin.
I’m hoping for a solution because I like the optionpage very much too.
See my post on this issue on the author’s plugin page.
In order to get this to work on existing posts that have not been re-saved after Lightbox 2 WordPress Plug activation, you have to update the code in version 2.0.2, lightbox.php, line 48. Add another check for the $lightboxoff condition.
function lightbox_wp_head() {
global $lightboxpluginpath, $post;
$lightboxcolor1 = get_option("lightbox_color1");
$lightboxlb_opacity = get_option("lightbox_lb_opacity");
$lightboxlb_resize = get_option("lightbox_lb_resize");
$lightboxoff = false;
$lightboxoffmeta = get_post_meta($post->ID,'lightboxoff',false);
// if ($lightboxoffmeta == "false") {
if ($lightboxoffmeta == "false" || $lightboxoffmeta == '') {
The function get_post_meta() will return an empty string if the post meta for that key is not found (as is the case for all posts created BEFORE the plugin is activated). Updating the check for both false and null string accomplishes this:
IF 1) there is lightbox 2 meta-data for this post and the ‘lightboxoff’ value is set to false
OR 2) there is no lightbox 2 meta-data for this post, so assume lightbox is turned on
This is an excellent plugin, but to assure that it works for posts created prior to activating the plugin, the code needs to be updated.
// if ($lightboxoffmeta == “false”) {
if ($lightboxoffmeta == “false” || $lightboxoffmeta == ”) {
The third parameter for get_post_meta does not work like get_option (return the third parameter if no value is found). It only serves to indicate whether to return the data, if found, as a string or an array.