Home › Forums › Front-end Issues › Simple, front-end form for a single field? › Reply To: Simple, front-end form for a single field?
acf_form()
allows setting to only include selected fields, see the fields
option https://www.advancedcustomfields.com/resources/acf_form/
To add the acf_form_head()
call to a specific template you could do this on the WP get_header
hook with a low priority
// include when template is page.php
add_action('get_header', 'include_acf_form_head', 1);
function include_acf_form_head() {
global $template;
$file = substr($template, strrpos($template, '/')+1);
if ($file == 'page.php') {
acf_form_head();
}
}
Your problem is going to be inserting the form into the page without modifying the theme. WP has not hooks, filters or actions that happen in the content area of the page that will allow you to call a function. The closest thing that you’ll get is the_content
. Unfortunately, this is run on every WYSIWYG editor.
Another choice, which is new today https://support.advancedcustomfields.com/forums/topic/create-front-end-form-using-shortcode/#post-38293
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.