Updated on 12 Mar 2025
In the Bricks Facebook group a user asks:
Merging images from different fields into a single gallery
Hi, I have a Gallery field created in ACF and a standard Featured Image field. Is it possible in Bricks to display images from both fields as a single gallery using dynamic data, for example, in a carousel element?
This Pro tutorial shows how render_tag() method of Bricks Providers PHP class can be used to get the image IDs of selected images of the specified ACF Gallery field and combine these with the current post's featured image ID and supplied as the dynamic data source for Bricks elements like Image Gallery.
We shall also add optional randomize and image count arguments in our custom function so the images can be shown in random order and the number of images to be shown can be set, if needed.
This also works with Meta Box and JetEngine and any other custom fields plugin that Bricks integrates with (see the list here) with minor changes.
Single Tutorial Purchase Option
Lifetime access to this single tutorial can be purchased for $20 here.
Step 1
Add the following in child theme's functions.php (w/o the opening PHP tag) or a code snippets plugin:
This is a BricksLabs Pro tutorial.
For full access login below or create your BricksLabs Pro account