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; }

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.

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 *.

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

Latest Posts

Hide the Page Title in the Hello Elementor Theme

Hiding the page title in the Hello Elementor theme allows you to create a cleaner and more customized page layout, free from default headings that may not fit your design. This is particularly useful for landing pages or custom content layouts where the default page...

How to Hide a Divi Module When Scrolling Up or Down

In this quick tutorial, I’ll show you how to hide a Divi module when scrolling in a specific direction (up or down), so that the module only shows when you want it to. This is especially useful when using Divi’s Scroll Effects feature and you have a effect you want to...

Fade a Divi Image Module Edge into the Background

Want to create a stylish fade effect on your Divi image module—where one side fades smoothly into the background? With a bit of CSS, you can make any edge (or corner) of the image fade out: top, bottom, left, right, or even diagonally.Fade a Divi Image Module Edge...

Hide the Header and Footer in the Hello Elementor Theme

Removing the default header and footer from your Hello Elementor theme allows for a streamlined and distraction-free website design. This is especially useful when creating unique landing pages, full-width layouts, or custom headers and footers with a page builder. In...

Setting up the Divi Password Box Module

Setting up password protection on a page can help you control access to sensitive or private content in WordPress, allowing only authorized visitors to view certain sections. With the Divi Password Box module, you can replace the plain Divi password form with a fully...

Random Posts