Hello,
I’m trying to include a way to edit in front-end mode the articles created with the acf_form function.
So I added the code <? Php acf_form (); ?> in the single file of my CPT.
The form appears and each field is editable. However, when I click on the button “update”, nothing happens. The button does not redirect to any page, the click acts as a simple refresh of the page.
Do you have any ideas ?
Thanking you in advance,
Willwoody.
Are you providing the current post ID in the “post_id” argument for acf_form()?
Hi,
Thanks for your quick response.
I putted this in my single.php file :
<?php acf_form(array(
'post_id' => $post->ID,
'post_title' => false,
'submit_value' => 'Update the post!'
)); ?>
Form appears with fields filled but on click on the ‘Update the post!’ button, still nothing happens. And when I hover the button, no link appears in the left-bottom of my browser. It’s like the button is pointing to nothing :/
Where in single.php? Inside “The Loop”?
Are the current values of the fields for the post your are editing appearing?
Hi,
I’m not using the Loop for this single.php, I’ve directly displayed my fields using get_field();.
In doubt, I’ve tried using the loop and putting inside the acf_form();. The result is the same.
Like I said, the values appears in each fields …Only the “Update” button doesn’t work 🙁
Did you put acf_form_head();
before any html output? Generally before get_header();
?