Making Simple Lightbox Work with Divi

Written by Dan Mossop

The Simple Lightbox plugin lets you add a "lightbox" effect to your blog images. Click on an image in one of your posts and, if it's linked to the (larger) original image will open in a slick semi-transparent overlay to the page, rather than in an otherwise bleak and empty webpage. Unfortunately, there are a couple of problems which stop Simple Lightbox working well with the Divi Theme. Here's what they are and how to fix them.

Fixing the Simple Lightbox "Strict" Errors

Depending on your debug settings, the first thing you may notice upon activating Simple Lightbox is a large number of error message filling the screen. They say something along the lines of:

Strict Standards: Declaration of SLB_Lightbox::_options() should be compatible with SLB_Base::_options($options_config = NULL) in C:\\blog\\wp-content\\plugins\\simple-lightbox\\controller.php on line 7

Strict Standards: Only variables should be assigned by reference in C:\\blog\\wp-content\\plugins\\simple-lightbox\\includes\\class.utilities.php on line 623

You have a couple of options in this case. One is that, if you don't need it, you can disable debug error messages in WordPress in general by removing this line from wp-config.php:

define('WP_DEBUG', true);

This will hide errors from all the plugins which may be a good thing. If, however, you're developing your own plugin and want to know about any errors, you can disable errors in just the Simple Lightbox plugin by changing the following in the main.php file of the Simple Lightbox plugin:

$slb = null;

To:

$slb = null;
error_reporting(E_ALL & ~E_STRICT & ~E_NOTICE);

Stop Divi Top Header Overlapping Simple Lightbox

When you click on an image, the Simple Lightbox plugin tries to darken the current page and show the image in an overlaid box. However, one Divi component refuses to darken and instead sits in front of the image box – the Divi top header (the one with the email / phone details). We can fix this with the following CSS:

#slb_viewer_slb_default { z-index: 100000 !important; }

We may earn a commission when you visit links on our website.

Enhance Your Blog with Dynamic CTAs

Transform your WordPress blog posts by adding highly-targeted call-to-actions with WP Magic CTAs. This AI-driven plugin helps increase audience engagement and conversion rates by creating CTAs that are as unique as your content.

Latest Posts

Customize Lightbox Title Styling in the Divi Gallery Module

Adjust the appearance of the lightbox title that appears when visitors open images from a Divi Gallery to align with your brand and improve readability. Refining the title’s color, size, and weight enhances visual hierarchy, accessibility, and overall polish. In this...

Center the Lightbox Image Count in the Divi Gallery Module

Centering the image count in a gallery lightbox creates a cleaner, more balanced presentation and makes it easier for visitors to see where they are in the image set. This simple visual tweak can enhance readability, especially with larger images and longer captions,...

Style the Divi Gallery Module Lightbox Image Count

Tailor the appearance of the image counter in the Divi Gallery module lightbox to match your brand and improve readability. By customizing the counter’s color and typography, you ensure it displays clearly and suits your design. In this guide we show you how to style...

Customize the Lightbox Image Background Color in the Divi Gallery

Control the color that appears behind your images when users open in the gallery lightbox, including support for semi-transparent hues. This helps improve contrast for transparent images, align the experience with your brand palette, and create a more polished viewing...

Style the Divi Gallery Lightbox Close Button

Give your gallery lightbox a clear, on-brand close button by customizing its color and size. This improves visibility and usability against varying image backgrounds and ensures the button renders at full opacity for a consistent experience. In this guide we show you...

About Dan Mossop

Dan is a Scottish-born web developer, now living in Brisbane with his wife and son. He has been sharing tips and helping users with Divi since 2014. He created Divi Booster, the first Divi plugin, and continues to develop it along with 20+ other Divi plugins. Dan has a PhD in Computer Science, a background in web security and likes a lot of stuff, 

4 Comments

  1. Can you add settings with footer paddings top and bottom? it will be very helpful

    Reply
    • Hi Grzegorz, thanks for the suggestion. It's definitely something I'll look into for a future version of the plugin.

      Reply
    • hi Guys

      Where do I store # top-header {z-index: 10000! Important; }

      thank you
      toni

      Stop Divi Top Header Overlapping Simple Lightbox

      When you click on an image, the Simple Lightbox plugin tries to darken the current page and show the image in an overlaid box. However, one Divi component refuses to darken and instead sits in front of the image box – the Divi top header (the one with the email / phone details). We can fix this with the following CSS:

      #top-header { z-index:10000 !important; }

      Reply

Submit a Comment

Comments are manually moderated and approved at the time they are answered. A preview is shown while pending but may disappear if your are cookies cleared - don't worry though, the comment is still in the queue.

Your email address will not be published. Required fields are marked *.