Special Offer: Get All 151 Premium WordPress Themes for Just $99.99 $59.99 Purchase Now Learn more

How to Display Caption in Lightbox Images

How to Display Caption in Lightbox Images

Our premium themes comes with built-in Lightbox which allow you to display images in dialog boxes.

We have updated our Lightbox JavaScript files to display captions (screenshot above). Here is a guide how it can be done:

1. Login to your Admin Panel, navigate to Left Menu -> Appearance -> Customize -> ‘Lightbox’ section and make sure the options for display of Lightbox are Checked.

2. Open a Page or Post for edit in Admin Panel

3. Insert an image with ‘Link to Media file’ option set

Link to Media File

3. Edit the image as HTML

edit image as HTML

5. At the and of <a > tag, inset data-title=”Your Caption TEXT”, i.e.

<figure class="wp-block-image"><a href="https://example.com/wp-content/uploads/2019/01/Papageitaucher_Fratercula_arctica.jpg" data-title="Lorem ipsum dolor sit amet, primis platonem dignissim"><img src="https://tishonator.com/dev/wp-content/uploads/2019/01/Papageitaucher_Fratercula_arctica-1024x683.jpg" alt="" class="wp-image-419"></a></figure>

6. Save Changes