19th Jul '24
/
0 comments

Post-specific HappyFiles Galleries using a ACF Select Field in Bricks

Post-specific HappyFiles Galleries using a ACF Select Field in Bricks

This Pro tutorial provides the steps to use ACF to select one or more HappyFiles' folders and output the images from the selected folder(s) using HappyFiles shortcode or Bricks' Image Gallery element or img elements in a query loop.

This is the equivalent of Post-specific HappyFiles Galleries using a Meta Box Select Field in Bricks tutorial but for ACF instead of Meta Box.

Step 1

Install and activate HappyFiles.

Go to Media → Library.

Create folders and categorize images by moving them into the folders.

Step 2

Install and activate ACF.

Go to ACF → Field Groups.

Create a new field group for your post type having a Select-type field.

Leave the Choices empty. We shall populate it programmatically in the next step.

If you would like to be able to select multiple folders, enable the "Select Multiple" option.

If you would like - Select - to appear as the 1st option for this field in the post editor screens, enable Allow Null in the Validation tab.

Step 3

Let's define a custom function to populate all HappyFiles folder names as options of above Select field.

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 633 Bricks code tutorials with BricksLabs Pro

Related Tutorials..

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
ACF Post Object Query Loop inside a Posts Query Loop in Bricks

ACF Post Object Query Loop inside a Posts Query Loop in Bricks

How to loop through a CPT and within each post, output a list of related posts.
Categories:
Pro
Conditional Output Based on ACF Date Field in Bricks

Conditional Output Based on ACF Date Field in Bricks

Updated on 1 Aug 2024 Looking to have a Section or other elements in Bricks rendered on the frontend only if today's date is before…
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
Sub Field Value from the Last ACF Repeater Row in Bricks

Sub Field Value from the Last ACF Repeater Row in Bricks

Getting the value of a specific sub field of an ACF Pro‘s Repeater field and output in the query loop.
Categories:
Tags:
Pro
Button to Open Bricks Gallery

Button to Open Bricks Gallery

How to trigger a click on the first image of a gallery in Bricks when a button is clicked.
Categories:
How to populate a map with dynamic markers from a CPT using ACF in Bricks (PART 2)

How to populate a map with dynamic markers from a CPT using ACF in Bricks (PART 2)

This tutorial provides the PHP & JS codes that can be pasted in order to create a flying effect on map markers each time your…
Pro
Meta Box/ACF Images Staggered Grid Gallery in Bricks

Meta Box/ACF Images Staggered Grid Gallery in Bricks

Showing images from two Gallery-type of ACF or Image Advanced-type of Meta Box fields in a staggered grid layout.
Pro
Related FAQs on Product pages Based on Product Category Taxonomy in Bricks

Related FAQs on Product pages Based on Product Category Taxonomy in Bricks

On product pages, we show all the FAQs associated with the current WooCommerce product's product categories.
Categories: