I am having issues implementing a frontend form using ACF Pro.
Currently, when I add acf_form_head();
as described in the ACF Pro documentation to my template. It gives me this error -
Warning: Cannot modify header information - headers already sent by (output started at /base.php:9) in /wp/wp-includes/pluggable.php on line 1207
The post is actually created, but it shows that error instead of redirecting to the new post.
I tried putting acf_form_head();
in the base.php file before get_template_part('templates/head');
That still gave me the same headers already sent by
error.
Then I tried putting it in the functions.php file like this
add_action( 'init', 'brandpage_form_head' );
function brandpage_form_head(){
acf_form_head();
}
This no longer gives me the headers already sent by
error, but instead it creates duplicate posts.
I’ve tried putting that acf_form_head(); function in header.php, head.php and in the footer, but nothing has worked yet.
Does anyone know where I should put this function in my Sage/Bedrock set up?
I appreciate the help!