5th Jun '24
/
2 comments

Dynamic HappyFiles Galleries using ACF Taxonomy Field in Bricks

Updated on 14 Feb 2025

This Pro tutorial provides the steps to output images from the selected HappyFiles gallery/galleries on single posts using ACF's Taxonomy-type custom field in Bricks.

Consider the following scenario.

Media Library with custom folders created using HappyFiles Pro:

CPT: service

Service Fields:

Service 1 post editor:

Service 1 front end:

Service 2 post:

Service 2 front end:

Service 3 post:

Service 3 front end:

We shall ensure that the Section is not output for posts that do not have at least one HappyFiles Folder selected.

Step 1

Create folders in your Media Library via HappyFiles.

Create a Taxonomy-type field attached to your post type.

Taxonomy: Folder

Toggle off 'Create Terms'

Return Value: Term ID

Edit your posts and tick the corresponding media folder for each.

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

Get access to all 610 Bricks code tutorials with BricksLabs Pro

Related Tutorials..

Pro
Conditional Output based on Date Time Picker Field in Bricks

Conditional Output based on Date Time Picker Field in Bricks

In the past, we showed how elements can be conditionally output based on a post's Date type of ACF field here. This Pro tutorial for…
Categories:
How to create parallax effects using Rellax.js in Bricks

How to create parallax effects using Rellax.js in Bricks

This tutorial provides the JS & PHP codes that can be pasted in order to create smooth parallax effects using the Rellax.js library inside Bricks…
Categories:
Pro
Merging ACF Gallery Images with Featured Image in Bricks

Merging ACF Gallery Images with Featured Image in Bricks

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…
Categories:
Pro
Dynamic HappyFiles Gallery in Bricks with Meta Box or ACF Pro

Dynamic HappyFiles Gallery in Bricks with Meta Box or ACF Pro

Updated on 12 Jul 2023 This Pro tutorial provides the steps to show the images uploaded to an "Image Advanced" type of custom field created…
Categories:
Pro
Conditional Rendering of ACF Repeater Rows Based on True / False Sub Field in Bricks

Conditional Rendering of ACF Repeater Rows Based on True / False Sub Field in Bricks

This Pro tutorial provides the steps to modify a ACF Repeater query loop to only output the rows for which a True / False type…
Categories:
Pro
Querying Posts by Date/Datetime Custom Fields in Bricks

Querying Posts by Date/Datetime Custom Fields in Bricks

This Pro tutorial shows how to configure ACF and Meta Box to query posts in Bricks by custom field(s) of the type Date/Date Time Picker…
Categories:
Tags: