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

Related Tutorials..

Pro
ACF Taxonomy Field Value in Single Posts

ACF Taxonomy Field Value in Single Posts

Consider this scenario: CPT: Movie Movie CPT Taxonomy: Movie Genre Movie Genre Taxonomy's field: Genre Color Each movie will have only genre set. The requirement…
Categories:
Tags:
ACF Repeater Sub Field Values as Tabs in Bricks

ACF Repeater Sub Field Values as Tabs in Bricks

Bricks' query loop supports ACF Repeaters and Meta Box Groups out of the box besides posts, users and terms. This tutorial shows how we can…
Categories:
Tags:
Pro
Querying Posts by Date/Datetime Custom Fields in Bricks

Querying Posts by Date/Datetime Custom Fields in Bricks

This Pro tutorial shows how to configure ACF and Meta Box to query posts in Bricks by custom field(s) of the type Date/Date Time Picker…
Categories:
Tags:
Color Custom Field as Section Background Color on Category/Term Archives in Bricks

Color Custom Field as Section Background Color on Category/Term Archives in Bricks

How to use a color from a taxonomy term custom field for as the hero section background color on archive pages.
Categories:
Tags:
Pro
CPT Submenu Items in ACF Pro Options Admin Menu

CPT Submenu Items in ACF Pro Options Admin Menu

This Pro tutorial provides the steps to add links to admin pages under an Options page created with ACF Pro. All code mentioned in this…