Support

Account

Home Forums Front-end Issues Title between field_groups

Helping

Title between field_groups

  • 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)

The topic ‘Title between field_groups’ is closed to new replies.