In the recent Bricks Image Gallery element with Image limit tutorial we showed how the built-in 'Image Gallery' element of Bricks can be duplicated and modified to only render a specific number of images. This method works regardless of the source of the images in the element - static or dynamic.
When the source is dynamic, there is a simpler way to limit the number of gallery images though - the render_tag() function in Bricks. This Pro tutorial provides the details.
Step 1
Using your favorite custom fields plugin add a field group for your post type having a field for multiple image upload/selection. Ex.: Gallery when using ACF or Image Advanced when using Meta Box.
Create/edit posts/Pages and select/upload the images for each.
Edit the Page/template with Bricks.
Add an Image Gallery element inside a Section's Container.
Click the power icon in the Images control and select your custom field. Copy the dynamic tag since we will use it in the next step (without the curly braces).
Step 2
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