Modula Link lets you open a gallery in the lightbox from a button, a text link or an image. The gallery itself isn’t shown on the page. Visitors click the link and browse the images in the lightbox, the large view that opens over the page.
Modula Link comes with Modula Pro, as a block and as a shortcode. If you want the gallery itself on the page, see how to add a gallery to a post or page.
Note: The lightbox opens only when the gallery’s images open in a lightbox. In the gallery’s Lightbox tab, On click must be Open in lightbox or Lightbox, or link when set. Slider galleries can’t be opened with Modula Link. The lightbox uses the gallery’s own lightbox settings, such as the title, caption and arrows.
Add the Modula Link block
The block adds a button that opens the gallery. Follow these steps to add one.
- Edit the page or post.
- Click + to add a block.
- Search for Modula Link and add it. Until you pick a gallery, the block shows the Modula Gallery logo and asks you to select a gallery. The panel on the right confirms it is the Modula Link block.
- In the block settings on the right, under Gallery Settings, pick the gallery in Select Gallery. Edit gallery opens that gallery in a new tab.
- Click the button on the page and type its text over Enter your message here.
- Style the button with the settings below. Pick the colors yourself. On the published page, the button only gets the colors you chose. A block you leave as it is looks like a plain link.
- Save the page.

Button style settings
Under Button Style Settings you can change the look of the button:
- Button Font Size: The size of the text. Pick Small (12 px), Medium (18 px), Big (26 px) or a custom size in pixels. If you don’t pick one, the text keeps your theme’s size.
- Button Size: Pick Small, Medium, Large or X-Large. This changes the button in the editor only. On the published page, every size looks the same.
- Button Text Color and Background Color: Pick a color or type its hex value, which is the color written as a code. The arrow next to the fields switches to RGB or HSL.
- Hover Text Color and Hover Background Color: The colors used while the mouse is over the button.
Border settings
Under Border Settings you can add a border around the button:
- Border Type: Pick Solid, Double, Dotted or Ridge.
- Border Width: Set it from 0 to 10 pixels.
- Border Color: Pick the color of the border.
- Border Radius: Sets how round the corners are, from 0 to 100 percent.
The border shows on the page once Border Type, Border Width and Border Color are all set.
Use the Modula Link shortcode
A shortcode is a short tag in square brackets that WordPress swaps for content. This shortcode makes a plain text link, which takes your theme’s link style. Put the text you want between the opening and closing tags:
[modula-link id="12"]View the gallery[/modula-link]Replace 12 with your gallery’s ID (how to find it).
You can also copy the shortcode with the ID already in it. Click Embed at the top right of the gallery editor. Then click Copy next to Modula Link (opens the gallery in a lightbox).

To add the shortcode to a page, add a Shortcode block and paste the shortcode into it.

Open the lightbox from an image
You can use an image instead of text. Put an image tag between the shortcode tags. A click on the image then opens the gallery in the lightbox. This works well as a cover image for a gallery:
[modula-link id="12"]<img src="https://example.com/wp-content/uploads/cover.jpg" alt="Our wedding gallery">[/modula-link]- Replace
12with your gallery’s ID. -
Replace the address after
src=with your image’s URL. To get it, go to Media → Library in list view, hover over the image and click Copy URL.
- Paste the shortcode into a Shortcode block and save the page.
Note: Type the quotes in the shortcode as straight quotes ("). Curly quotes, which some editors add when you paste, stop the shortcode from working.