WordPress plugin
ACF Theme Code PRO
ACF Theme Code PRO generates implementation code from Advanced Custom Fields field groups and separate registration code for field group locations. Field code reflects the names and options in each group, giving developers code to use in custom theme templates.
ACF Theme Code PRO generates implementation code from Advanced Custom Fields field groups and separate registration code for field group locations. Field code reflects the names and options in each group, giving developers code to use in custom theme templates.
Find and use field group code
After you publish, edit, or update an ACF Field Group, its Theme Code section appears at the bottom of the editing page. Review the generated code and use the clipboard icons to copy code blocks into theme templates instead of writing each field reference manually.
The generated code is based on the official Advanced Custom Fields documentation and includes output escaping. Product information describes the code as tested and designed with speed and flexibility of implementation in mind.
Supported fields and ACF PRO features
The add-on supports standard ACF fields and selected third-party fields. The PRO edition also works with these complex ACF PRO field types:
- Repeater
- Flexible Content
- Gallery
- Clone
ACF Blocks and Options Pages are supported as well.
Generate field group location code
For location registration, use the Theme Code Location Registration Tool on the ACF Tools page. It generates code for field group locations, including more complex location settings. Supported location types include Block, Options Page, Widget, Taxonomy, Comment, Attachment, Current User, and User Form.
Workflow for generating theme code
- Create or edit an ACF Field Group.
- Configure the field names, settings, and locations required by the project.
- Save or update the field group.
- Open the Theme Code section to review the generated implementation code.
- Use the clipboard controls to copy relevant code blocks into theme templates.
Use the location registration tool on the ACF Tools page when you need code for the field group locations.
Requirements and installation
The WordPress site must have Advanced Custom Fields or ACF PRO version 5.8.9 or higher. Once that extension is available, install and activate ACF Theme Code PRO. Create or edit a field group to access its Theme Code section, and use ACF Tools to generate location registration code.
The add-on is for developers building custom WordPress themes with field-specific implementation code and ACF location registration.