Support

Account

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 
      }
    }