Home › Forums › Feature Requests › acf_form() on the front end › Reply To: acf_form() on the front end
WordPress fires the get_header
action before getting the header file, so you can enable acf forms on the entire site by doing something like this.
add_action('get_header', 'site_wide_acf_forms');
function site_wide_acf_forms() {
acf_form_head();
}
You could add checks to only call acf_form_head() on certain templates or other conditions.
As far as calling acf_form() in the templates where you want the to show, I don’t think there’s anything that ACF can to about that. There aren’t any hooks build into WP that fire in the template again until you get to get_footer();
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.