ACF Theme Code

Description

ACF Theme Code is an extension for the awesome Advanced Custom Fields plugin.

When you publish, edit or update an ACF Field Group, the code required to implement each field is displayed for you in the Theme Code section at the bottom of the page.

The code is based on the ACF documentation and it’s automatically updated to match the fields you have created.
Use the clipboard icon to easily copy these code blocks and paste them into your theme to get you started and save loads of time!

Features include:

  • Easily copy the code into your theme
  • Great for offline documentation
  • Based on the official ACF documentation
  • Field names and variables are automatically updated

Support for the following fields:

  • Text
  • Text Area
  • Number
  • Email
  • Password
  • WYSIWYG
  • File (Object, URL and ID return values)
  • Image (Object, URL and ID return values)
  • Select (single and multiple values)
  • Checkbox
  • Radio
  • True / False
  • User
  • Google Map
  • Date Picker
  • Colour Picker
  • Page Link (single and multiple values)
  • Post Object (single and multiple values)
  • Relationship (Object and ID return values)
  • Taxonomy (Checkbox, Multi Select, Radio Buttons and Select field types)

Upgrade to ACF Theme Code Pro
ACF Theme Code Pro generates code for all ACF Pro field types including the Clone, Repeater, Gallery and Flexible Content field.
Our Pro version also generates code for a range of popular 3rd party fields and we generate code for location rules including Options Pages!
Find out more about ACF Theme Code Pro

Requires

  • ACF version 4.4.7 or higher
  • ACF Pro version 5.4 or higher

Thankyou

Thanks to all of our beta testers including Elliot Condon, Phil Smart, Richard Johnston & James Bundey!

Screenshots

  • When you publish, edit or update an ACF Field Group, the code required to implement each field is displayed for you in the Theme Code section. Use the clipboard icon to easily copy these code blocks and paste them into your theme.

Installation

  1. Upload ACF Theme Code to /wp-content/plugins/
  2. Activate the Plugin via the plugins menu
  3. Create or Update an ACF Field Group
  4. Scroll down to see the ACF Theme code

FAQ

Installation Instructions
  1. Upload ACF Theme Code to /wp-content/plugins/
  2. Activate the Plugin via the plugins menu
  3. Create or Update an ACF Field Group
  4. Scroll down to see the ACF Theme code
Does this plugin support ACF Pro ?

This plugin has basic support for ACF Pro (we support all the fields found in the ACF free version).
Our premium version – ACF Theme Code Pro supports all the fields in ACF Pro, a range of other 3rd Party Fields & locations rules (like options).

Why is there so many PHP tags in the code that’s generated ?

At the moment it’s for developer convenience, so you can easily wrap our code in your own HTML markup.
We’re open to suggestions and keen to improve the code generated based on community discussion.

Reviews

Nice

This has saved me loads of time. I have the pro version.

AWESOME!

From a newbie WP User. This makes using and learning ACF so much easier Thank You!

Huge time and energy saver!

Love it! It’s so much more accessible (and faster) than trying to read through the ACF docs, and I’m even learning better ways to write my code from it!

Speeds up my dev process so much, and saves me lots of mental energy in the process.

Really grateful for ACF Theme Code!

Great time saver

No more constantly referring to the ACF documentation for the right ACF code. This plugin gives you the ACF theme code for the ACF field you are currently working on, right where you are working on it.

A huge time saver when working with ACF, thanks guys!

Stunning!

Awesome add-on for ACF. It will certainly speed up theme development.

So much freeness!

I’m going to use all the free time this plugin gives me to, I don’t know, catch up on sleep! I have a terrible memory when it comes to PHP code, so I’m constantly on the ACF site searching for the right code block. This cuts out all that effort. I wish I could give it six stars.

Read all 7 reviews

Contributors & Developers

“ACF Theme Code” is open source software. The following people have contributed to this plugin.

Contributors

Changelog

1.3.1

  • Fix: Updates to array count functionality for PHP 5.4

1.3.0

  • Core : Support for ACF Pro when bundled in a Theme
  • Fix : HTML output by the File field is now valid
  • Core : Notice for location rule support (now in ACF Theme Code Pro)

1.2.0

  • Core: Quicklinks feature with anchor links to the relevant theme code block
  • Core: Notice updates & various bug fixes

1.1.2

  • Fix: Use the_sub_field method for nested File fields with return format URL

1.1.1

  • Field: Post Object field now works correctly for ACF 4
  • Core: Various internal code improvements

1.1.0

  • Fields: All field formatting improved inline with ACF Theme Code Pro

1.0.0

  • Core: First version