Support

Account

Home Forums Front-end Issues Title between field_groups

Helping

Title between field_groups

    • frank

    • May 4, 2020 at 4:08 am

    Hi All,
    I would like to know if there is another way to put a title between field_groups on an acf_form than this one:

        <form id="post" class="acf-form" action="" method="post">
    
        <?php acf_form( array(
            'post_id'	=> 'new',
            'field_groups' => array(394),
            'form' => false,
    		'post_status'	=> 'publish',
    		'post_type'		=> 'parutions',
    		'updated_message'    => 'Le nouveau numéro vient d’être créé',
        )); ?>
    
        <h2>1 title</h2>    
        
        <?php acf_form( array(
            'post_id'	=> 'new',
            'field_groups' => array(267),
            'form' => false,
    		'post_status'	=> 'publish',
    		'post_type'		=> 'parutions',
    		'updated_message'    => '',
        ));
        ?>
    
        <h2>2 title</h2>    
        
        <?php acf_form( array(
            'post_id'	=> 'new',
            'field_groups' => array(323),
            'form' => false,
    		'post_status'	=> 'publish',
    		'post_type'		=> 'parutions',
    		'updated_message'    => '',
        ));
    // ... ect...
        ?> 
          
        <div class="field">
            <input type="submit" value="Creation d'une nouvelle parution">
        </div>
        
    </form>
    

    I have an array of 7 items…
    Thank you in advance.
    Frank

  • Hi Frank,

    The HTML titles you’ve posted look perfectly fine but you could add them into the acf_form function using html_before_fields or html_after_fields.

    So the second block would be amended as follows:

    
    acf_form( array(
        'post_id'	      => 'new',
        'field_groups'    => array(267),
        'form'            => false,
        'post_status'.    => 'publish',
        'post_type'	      => 'parutions',
        'updated_message' => '',
        'html_before_fields' => '<h2>1 title</h2>'
    ));
    

    I hope this helps.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.