4th Apr '23
/
0 comments

Sorting ACF Repeater Query by Sub Field in Bricks

This Pro tutorial shows how the rows of a ACF Repeater can be sorted alphabetically by the value of one of its sub fields when using Bricks.

Repeater being populated for a Page:

Before implementing the tutorial:

After:

Set up the field group as shown earlier.

Edit the singular template for your post type to which you have attached the field group with Bricks.

Copy and paste the Section's JSON from here.

Add the following in child theme's functions.php 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
x Number of Random Bricks Query Loop Items(s) to be Shown Every x Hours

x Number of Random Bricks Query Loop Items(s) to be Shown Every x Hours

Showing how to display one random row of a Meta Box group for an hour and then output another random row.
Pro
ACF Term Meta on Single Posts in Bricks

ACF Term Meta on Single Posts in Bricks

Consider this scenario: CPT: Project Custom taxonomy: Project Type Each project will be assigned only one project type. Project Type taxonomy's custom field: Project Type…
Categories:
ACF Relationship: Count of Related Posts

ACF Relationship: Count of Related Posts

Looking to get the number of CPT B posts related to a CPT A post when using a Relationship field with ACF? Here's a custom…
Categories:
Tags:
Pro
Prefiltering Bricks Terms Query Loop

Prefiltering Bricks Terms Query Loop

Let's say there's a Events CPT with a 'Event Year' custom taxonomy. Sample event year names could be: 2021, 2022, 2024, 2025, 2028 etc. We…
Term-specific single post template in Bricks

Term-specific single post template in Bricks

Updated on 25 Jun 2025 In Reddit a user asks: Template conditional logic to exclude pages with a particular taxonomy term? I can't figure out…