Home › Forums › Front-end Issues › Frontend form Edit Post link › Reply To: Frontend form Edit Post link
This didn’t seem to work for me, but I didn’t spend much time looking through the link you provided. I had, in the meantime, cobbled together another solution that may work for someone else as well:
Goes below your single-post display, within the post loop
<div class="edit-form">Edit this submission</div>
<div class="form-off"><?php acf_form(); ?></div>
<script>
$ = jQuery;
$(".edit-form").click(function(){
$(".form-off").toggleClass("form-on");
$(this).toggleClass("form-on");
}, function() {
$(".form-off").toggleClass("form-on");
});
</script>
In your stylesheet
.form-off {
visibility: hidden;
}
.form-on {
visibility: visible;
}
This may not be the most elegant way to do things, but it worked for me.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
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.