• I used to use the plugin for quite some time and it was working and looking great.
    After upgrading WP to 2.7 and the plugin to its latest version is was not working properly. It seemed to me that the script was not included into the HTML.
    I installed the other Lightbox 2 plugin from Rupert Morris as a workaround, but I would like to get back to the original one. I like the option page very much.

Viewing 2 replies - 1 through 2 (of 2 total)
  • 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.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Lightbox 2] Issues on WP 2.7’ is closed to new replies.