Home › Forums › General Issues › Organize fields in acf_form() › Reply To: Organize fields in acf_form()
My mistake, you can’t do render field based on the field key. You can only do it generically for every field or for a specific field type. You need to check for the field you want to add the html to in the function.
add_action('acf/render_field', 'add_address_heading', 1, 1);
function add_address_heading($field) {
if (is_admin()) {
// only on the front end
return;
}
if ($field['key'] == 'field_573d84b07da66') {
?><h2>Address</h2><?php
}
}
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.