I have frontend posting working, but when I go to edit the frontend post (on the frontend) I make the edit and save but nothing saves.
Here is what I have for the frontend posting section on the Template Page:
<?php
acf_form(array(
‘post_id’ => ‘new_post’,
‘field_groups’ => array(57),
‘post_title’ => true,
‘meta_input’ => $_POST[‘acf’][‘field_5a74c753efdce’],
‘post_content’ => false,
‘form’ => true,
‘new_post’ => array(
‘post_type’ => ‘announcements’,
‘post_status’ => ‘publish’
),
‘return’ => ‘%post_url%’,
‘submit_value’ => ‘Add Post’,
));
echo ‘</div>’;
?>
<!—— If user is not admin ——>
<?php
} else {
echo ‘<h2>Sorry, you must be an administrator to access this page.</h2>’;
}
?>
Here is what I have for the single page for editing:
<h2><?php the_title(); ?></h2>
<!– Gallery Images for post –>
<?php if( get_field(‘announcement_gallery’) ) { ?>
<?php
$gal_images = get_field(‘announcement_gallery’);
if( $gal_images ): ?>
<?php endif; ?>
<?php } ?>
<!– End Gallery Images for post –>
<p><?php the_field(‘announcement_content’); ?></p>
<!– Script/Code for toggle editor –>
<?php $current_user = wp_get_current_user(); if ( $current_user->ID == $post->post_author ) { ?>
<script>
$( document ).ready(function() {
$( “#editor-btn-wrap #edit-btn” ).click(function() {
$( “#editor-btn-wrap form” ).css( “display”, “block” );
$( “#cancel-btn” ).css( “display”, “inline-block” );
});
$( “#editor-btn-wrap #cancel-btn” ).click(function() {
$( “#editor-btn-wrap form” ).css( “display”, “none” );
$(this).css(“display”, “none”);
});
});
</script>
<div id=”editor-btn-wrap”>
<span id=”edit-btn”><i class=”fa fa-pencil-square-o”></i> Edit Post</span><span id=”cancel-btn”><i class=”fa fa-times”></i> Cancel</span>
<?php acf_form(); ?>
</div>
<?php } ?>
Not sure what I need to do to get the single page to edit and save to the post. Any help would be great.