Buy All 48 Premium WordPress Themes for $54.99

How to Display Caption in Lightbox Images

LightBox Display Caption

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

About the Author

Tihomir Ivanov is a WordPress and Salesforce Commerce Cloud (SFCC) developer, founder of tishonator.com, a fan of Linux and Open Source, Minimalism (in Design and Life), Sci-fi, Fantasy, Classic and History books :)

Leave a Reply