Support

Account

Home Forums Front-end Issues Render Field Group Titles on Front End Reply To: Render Field Group Titles on Front End

  • Here’s what I did as a work around. I have to believe there is a more elegant way to do this, fewer db calls and such. I’ll have to research this in the future.

    Layout of the Entry Post Type:

    • ACF FORM (single-entry.php)
      1. Category One Field Group (Entry Post Type Selected in Admin)
      2. Category Two Field Group (Entry Post Type Selected in Admin)
      3. Category Three Field Group (Entry Post Type Selected in Admin)

    I took the field key from the first field in the Field Group and ran a prepare_field for each.

    add_filter('acf/prepare_field/key=field_58f8d36119412', 'format_entry_header');	// Category One Header
    

    When found, the prepare_field outputs a <div> with my Header Information. This in displayed before the Field and with a little CSS, looks good.

    echo '<h3 class="entry-form-title">Maintenance Factors</h3>';
    

    The drawback is that you can not have the fields in a tab or you will get the <div> at the bottom of the first tab AND where intended. Haven’t dug into this much more as I need a solution quickly.

    Not sure I should mark this as solved?