Generate code for fields and locations
ACF Theme Code PRO provides two code generators for different tasks. After you publish, edit, or update an ACF Field Group, its implementation code appears in the Theme Code section at the bottom of the Edit Field Group page. The code uses that group’s field names and options. Review it there, then use the clipboard icons to copy code blocks into theme templates.
For field group location registration code, use the Theme Code Location Registration Tool on the ACF Tools page. It generates code for configured locations, including more complex ACF Field Group Locations.
ACF and ACF PRO field support
The extension supports standard ACF fields and selected third-party fields. The PRO edition also supports these complex ACF PRO field types:
- Repeater
- Flexible Content
- Gallery
- Clone
ACF Blocks and Options Pages are supported as well. The generated code is based on the official Advanced Custom Fields documentation and includes escaping for output. Product information describes the code as tested and designed with implementation speed and flexibility in mind.
Supported location types
The PRO location tool supports Block, Options Page, Widget, Taxonomy, Comment, Attachment, Current User, and User Form locations. Use it to turn field group location options into registration code alongside the implementation code for your fields.
Workflow and requirements
- Install and activate Advanced Custom Fields or ACF PRO version 5.8.9 or higher on the WordPress website.
- Install and activate ACF Theme Code PRO.
- Create or edit an ACF Field Group and configure its field names, settings, and locations.
- Save or update the field group.
- Open its Theme Code section to review the generated implementation code.
- Use the clipboard controls to copy relevant code blocks into theme templates.
When you need location registration code, open the ACF Tools page and use the Theme Code Location Registration Tool. The generated field code reflects the configured group, so developers can work with standard ACF fields as well as the supported complex fields, Blocks, and Options Pages.
