Gallery Grid Image Lightbox

Description

  • Keep Image Caption in Lightbox View
  • Keep Caption format in Lightbox View
  • Option to hide Captions from Gallery View
  • Works with Gallery Section Grid only
  • Works with Personal/Basic Plan

Gallery grid image lightbox 1

#1. Install Code

#1.1. Business Plan/higher

Hover on page where you use Gallery Grid > Click Gear icon

Gallery grid image lightbox 3

Click Advanced > Paste this code

<!-- @tuanphan - Gallery Grid Lightbox -->
<link rel="stylesheet" href="https://code.beaverhero.com/file?filename=1761192491851gallerygridimglightbox.css"/>
<script src="https://code.beaverhero.com/file?filename=1761192424950gallerygridimglightbox.js"></script>

Gallery grid image lightbox 2

#1.2. Personal/Basic Plan

First, edit Site Footer > Add a Section (if you already have a section, skip this step)

Gallery grid image lightbox 4

Hover on top left of Footer > Click Add Block

Gallery grid image lightbox 5

Choose Markdown

Gallery grid image lightbox 6

Paste this code into Markdown

<link rel="stylesheet" href="https://code.beaverhero.com/file?filename=1761192491851gallerygridimglightbox.css"/>
<script src="https://code.beaverhero.com/file?filename=1761192424950gallerygridimglightbox.js"></script>

Gallery grid image lightbox 7

#2. Usage

First, make sure you use Gallery Grid

Gallery grid image lightbox 8

Next, make sure you enabled Captions + Lightbox

Gallery grid image lightbox 9

Next, make sure you added text to Image Description

Gallery grid image lightbox 10

If you want to make text italic, wrap it in <em> tag

Gallery grid image lightbox 11

to make bold, use <strong> tag

Gallery grid image lightbox 12

#3. Customize

To make text disappear from Gallery View, you can use this code to Custom CSS.

body {
    --hide-gallery-view: none;
}

Gallery grid image lightbox 13

#3.1. To add swipe features on mobile, use this code under plugin code

(If Personal/Basic Plan, you can add it under code in Markdown Block)

<script src="https://code.beaverhero.com/gallerysgrid/gallerygridlibswipe.js"></script>

Gallery grid image lightbox 1

If you want to hide both arrows on mobile, use this to Custom CSS

@media screen and (max-width:767px) {
    .tp-grid-lb-arrow {
        display: none;
    }
}

Gallery grid image lightbox 2

#3.2. To change overlay color to black and arrows/close to white, like this

Gallery grid image lightbox

You can use this code to Custom CSS

/* Overlay color */
.tp-grid-lb-overlay {
    background-color: #000;
}
/* close */
button.tp-grid-lb-close path {
    stroke: #fff;
}
/* arrows */
button.tp-grid-lb-arrow * {
    stroke: #fff !important;
}
/* text color */
.tp-grid-lb-caption {
    --lightbox-caption-color: #fff;
}

 

Buy me a coffee