10th Dec '22
/
2 comments

ACF Date Field Value Custom Format in Bricks

In the Bricks forum, a user asks:

Hi there, I am setting up an events calendar using bricks.

In some circumstances I would like to display the date of the event as just ‘21 Dec’ and in other places with the year too and maybe written day i.e. ‘Friday 21 Dec 2022’ .

I have created a custom field with acf for the date and it works great in my repeater on the front end, but how can I change the output of the date on a case by case basis?

Simplified I’d like to do something like {acf_date:d j}

This Pro tutorial shows how we can define a custom function and use that with the Dynamic data feature of Bricks to output any Advanced Custom Fields' Date-type of field in the specified format.

Step 1

Edit the Date Picker-type of field in your field group.

This is a BricksLabs Pro tutorial.

For full access login below or create your BricksLabs Pro account

Get access to all 624 Bricks code tutorials with BricksLabs Pro

Related Tutorials..

Pro
Bidirectional Relationship between a CPT and a Taxonomy of another CPT using ACF in Bricks

Bidirectional Relationship between a CPT and a Taxonomy of another CPT using ACF in Bricks

A couple of members asked: I have a cpt called "Markets" aand a cpt "tools". Tools have a taxonomy "tools group". How can i create…
Custom Function for ACF Link Field

Custom Function for ACF Link Field

How to output the label of an ACF link field through Dynamic Data.
Categories:
Tags:
Pro
Bricks Dynamic Data Tag for Text-type Custom Field Value with Word Limit

Bricks Dynamic Data Tag for Text-type Custom Field Value with Word Limit

How to register a new dynamic tag for setting excerpt word limits and outputting an ellipsis (...) at the end.
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: