Creating a Field Group

Overview

ACF uses field groups to attach fields to posts. Each field group contains a title, fields, location rules and visual settings. To create a field group, click on the Custom Fields menu item. You will see a welcome screen like this:

Add New

Clicking the “Add New” button will create a new Field Group. When editing a field group, you will see 3 areas of interest; Fields, Location and Options.

Title

Each field group requires a title. This title is shown in the metabox handle on the edit screen. A good tip is to use relevant titles such as “Home Page” or “Event”

Fields

Here you can create and manage a variety of custom fields. Clicking the “Add Field” button will create a new field and add it to the bottom of the list (you can reorder your fields by dragging the order number as a handle). Adding a field will look like this:

Each field requires a Label, name and type. All other options are not required and will change depending on the field type.

The field label is visible when entering content but is not used by the API, use capitals and spaces for a human friendly field label.

The field name is the computer version which should be lowercase and have no spaces / special characters. This name is used in your templates to retrieve the content / data.

Hovering over the grey bar at the top of the field will reveal action buttons similar to any other WP list. These actions allow you to delete, edit (open / close) and duplicate the field.

Location

The location box allows you to create a set of rules which decide when and where to add these fields to the edit screen / post object. Here is an example of some location rules which will make this field group appear only on pages where the template chosen is “Sidebar Template”

Please note that location rules can be grouped together to create any combination of and and or statements.

Options

For each field group, there are a few simple options to help customize the edit screen where this field group appears. If you have multiple field groups appearing on a page, the first field group’s options will be used. This is why you can set a order number. Field groups are loaded and displayed in order of their “order no” where 0 is the first and 99 is the last.