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 Color

Requirement: Get the project type color of the project type that's assigned to the current single Project page being viewed.

This Pro tutorial shows how ACF term meta can be output on single posts in Bricks.

ACF field group definition:

'Development' project type term:

A project post having 'Development' project type:

On the front end after implementing the tutorial (notice the post title's color):

'Design' project type term:

A project post that's assigned to 'Design' type on the front end:

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

Get access to all 525 Bricks code tutorials with BricksLabs Pro

Related Tutorials..

Pro
How to Update Custom Fields with Default Values For Existing Posts when using ACF

How to Update Custom Fields with Default Values For Existing Posts when using ACF

Let's take a scenario where there are 10 Pages in a WordPress site. You proceed to create a Text-type of custom field called, say, "Custom…
Categories:
Tags:
Pro
ACF Options Fields in Bricks

ACF Options Fields in Bricks

This Pro tutorial walks you through outputting the values of custom fields attached to an ACF Pro's Options page in Bricks builder. We shall register…
Categories:
How to conditionally load your scripts based on an ACF field

How to conditionally load your scripts based on an ACF field

This tutorial provides the PHP codes that can be pasted in order to enqueue your scripts conditionally based on the value of an ACF field…
Categories:
Pro
Category Grid with ACF Images in Bricks

Category Grid with ACF Images in Bricks

Creating a grid of post categories, each category card showing an image from an ACF field, category name & description.
Categories:
Pro
ACF Relationship: Show all other events related to the artists of the current event

ACF Relationship: Show all other events related to the artists of the current event

How all other events related to the artists of the current event can be output in a Bricks query loop.
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:
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…