18th Mar '24
/
12 comments

Dynamic Galleries with Thumbnails and Captions in Lightbox using lightGallery in Bricks

Updated on 19 Apr 2024

This Pro tutorial provides the steps to load and initialize lightGallery on the images coming from a Gallery type of ACF field or an Image Advanced type of Meta Box field and being output using a Posts → Media Bricks query loop for a dynamic thumbnail gallery with support for thumbnails and captions inside the lightbox.

Note: The video was recorded before making a settings change to load the images in the correct order.

Step 1

Create a field group for your desired post type having a 'Gallery' type of field with ACF or an 'Image Advanced' type of field with Meta Box.

Meta Box screenshots:

Step 2

Edit your posts and upload/select images for your field.

Step 3

Edit your Page/template with Bricks and add a Section.

Inside the Section's Container, add a Container.

Change its HTML tag to ul.

Display: grid

Gap: 1em

Grid template columns: repeat(3, minmax(0, 1fr))

In the STYLE tab, go to CSS control group and add this class: lightgallery

Add a Block inside having a HTML tag of li and set Display to block.

Enable query loop.

Post type: Media

This is a BricksLabs Pro tutorial.

For full access login below or create your BricksLabs Pro account

Get access to all 630 Bricks code tutorials with BricksLabs Pro

Related Tutorials..

Pro
CPT Submenu Items in ACF Pro Options Admin Menu

CPT Submenu Items in ACF Pro Options Admin Menu

This Pro tutorial provides the steps to add links to admin pages under an Options page created with ACF Pro. All code mentioned in this…
Accessing ACF Repeater Sub Fields Programmatically in Bricks Query Loop

Accessing ACF Repeater Sub Fields Programmatically in Bricks Query Loop

It is possible to output sub field's values when a Bricks query loop's type has been set to a ACF Repeater without writing code. This…
Categories:
Pro
ACF Font Awesome Field in Bricks

ACF Font Awesome Field in Bricks

We walk through using the Advanced Custom Fields: Font Awesome Field plugin for showing Font Awesome icons.
Categories:
Tags:
How to create a dynamic infinite logo slider with ACF and Bricks

How to create a dynamic infinite logo slider with ACF and Bricks

This tutorial provides the builder settings, PHP & CSS codes that can be pasted in order to create an infinite logo slider in pure CSS…
Pro
Related Posts using ACF Post Object in Bricks

Related Posts using ACF Post Object in Bricks

Modifying the query loop to limit the posts to only related posts via an ACF Post Object custom field.
Categories:
Tags:
Output HappyFiles Folders in Metabox Select-Field

Output HappyFiles Folders in Metabox Select-Field

This tutorial is part of a series where I'm gonna show you how to output custom HappyFiles Galleries and Sliders. Part one will cover a…
Categories: