28th Jun '22
/
3 comments

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 a phone text-type of field and a social group-type of field having facebook and twitter text-type of custom fields.

Then output the value of the phone field in the header like this:

when hovered

and the values of Facebook and Twitter fields inside the group as the URLs of the items in an Icon List element.

Step 1

Install and activate ACF Pro.

Create the Options page by adding the following in child theme's functions.php:

// Add ACF options page. if ( function_exists( 'acf_add_options_page' ) ) { acf_add_options_page(); }

Add a new Field Group and create the fields mentioned near the beginning of the article.

You could alternately import this (mirror) field group from our test site.

Ensure that the Options page is selected in the Location meta box.

Step 2

Click on Options menu item in the admin menu and populate the fields.

Step 3

Edit your Header Template with Bricks.

Add a Container in the appropriate location in the structure that is going to be the parent Div for Icon and Basic Text elements.

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..

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
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
Outputting ACF Repeater’s Sub Fields

Outputting ACF Repeater’s Sub Fields

This Pro tutorial provides the code for printing custom HTML after looping through rows of a ACF Repeater (available in ACF Pro) that has a…
Categories:
Pro
Customizing ACF Repeater/Relationship or Meta Box Relationship Query Parameters in Bricks

Customizing ACF Repeater/Relationship or Meta Box Relationship Query Parameters in Bricks

For query types other than post, term and user in Bricks i.e, ACF Repeater/ACF Relationship/Meta Box Relationship there are no built-in controls for modifying the…
Categories: