Change the Divi Gallery Module Image Count Separator

Written by Dan Mossop

Change how the Divi Gallery module lightbox displays image counts by replacing the default separator with your preferred characters (for example, turning "1 of 2" into "1 / 2"). Adjusting the separator can improve readability, better match your brand style, and support localization preferences. In this guide we show you how to set a custom separator for the image count shown in the Divi Gallery lightbox.

Customize the Image Count Separator in the Divi Gallery Lightbox using the Divi Gallery Booster / Divi Booster

This method updates the gallery lightbox counter by setting the 'Image Count Separator' field provided by both the Divi Gallery Booster and Divi Booster plugins within the Gallery module’s Elements settings. It’s a quick, no‑code approach that lets you use a custom separator like ' / ' and confirms the change appears correctly in the front-end lightbox counter.

Set the Image Count Separator in Divi Gallery Booster

To customize the separator for your gallery image counter, open your gallery module in the Divi Builder. In the module settings, navigate to the 'Elements' section. Look for the field labeled 'Image Count Separator', and enter your preferred separator, such as ' / '. 

Save and View Your Gallery Lightbox

Once you've set your preferred separator, publish your page to save the changes. Then, view your page on the front end and click on a gallery image to open the lightbox. You should see the custom separator, like "1 / 2", in the image counter. This confirms your setting is active.

Customize the Divi Gallery Lightbox Counter Separator using jQuery

This method demonstrates changing the Divi Gallery lightbox counter to use a custom separator by adding a small jQuery snippet in Divi Theme Options Integration tab. It’s a quick, plugin-free approach that applies site‑wide, keeping your gallery UI consistent without editing individual modules.

Add Custom jQuery Script in Divi Theme Options

From your WordPress dashboard, go to Divi > Theme Options and open the 'Integration' tab. In the field labeled "Add code to the of your blog", paste the following code, then be sure to save your changes:

*Tip: This jQuery snippet will update the counter separator across all gallery lightboxes on your site, so you only need to add it once.*

<script>
jQuery(document).ready(function($) {
    setTimeout(
        function() {
            $('.et_pb_gallery_items').data('magnificPopup').gallery.tCounter = '%curr% / %total%';
        },
        0
    );
});
</script>

Publish and Test the Gallery Lightbox

After saving your changes, add a Gallery module to a page if you haven't already. Publish your page, then view it on the front-end. Click on a gallery image to open the lightbox. You should see your custom separator, such as "1 / 2", in the image count display.

Conclusion

Customizing the gallery lightbox image counter separator in Divi is easy—whether you use the Divi Booster / Divi Gallery Booster field for individual modules or apply a simple jQuery script for a sitewide change. Now, you can keep your site formatting and branding consistent with just a few quick steps.

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

Discover Divi Gallery Booster

Divi Gallery Booster enhances your Divi gallery modules with features like changing the image count separator, styling options, and much more. It's perfect for customizing and optimizing your gallery displays without needing extra fluff.

Latest Posts

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

Add a Visible Shadow to Divi Gallery Lightbox Arrows

Give the lightbox navigation arrows in your Divi galleries a stylish pop and improve their visibility by adding a shadow beneath the arrows. This quick guide will show you how to make your navigation arrows stand out against the lightbox overlay.Add a Visible Shadow...

Adjust Lightbox Arrow Size in Divi Gallery

Customize the size of the navigation arrows that appear in your gallery lightbox so they’re easier to see and aligned with your site’s design. Whether you want larger, more accessible controls or a subtler look, setting a precise arrow size creates a more polished...

Change Lightbox Arrow Color in the Divi Gallery Module

Make the lightbox navigation arrows in your Divi Gallery match your brand and stand out against your images by assigning a custom color. This improves visual consistency, enhances accessibility with better contrast, and elevates the overall browsing experience for...

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, 

0 Comments

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

Works with Divi 5

This feature has been tested and confirmed to work with Divi 5.

Works with Divi 4

Gallery Booster

All the Divi Gallery module features you need!

All licenses are lifetime – pay once, use forever.

Divi Booster

Hundreds of new features for Divi!

All licenses are lifetime – pay once, use forever.