Support

Account

Home Forums Pre-purchase Questions acf_form and AMP Reply To: acf_form and AMP

  • This depends on how you implement it. The function acf_form_head() call that is required needs to be before any html is output. Calling this function is what causes all of the JS to be loaded and what causes the form to be processed when submitted.

    If you put this in your header.php file then it will be loaded site wide.

    If this is put in the template file for the page just before get_header() then it will be loaded on any page using that template.

    You can have it loaded on just pages that have use acf_form() by creating a page template that will only be used for these pages.

    There are potentially other ways that this can be done as well but each gets a little more complicated.

    For example, you could have an init action

    
    add_action('init', 'some_function_name_here');
    some_function_name_here() {
      if (/*some condition*/) {
        acf_form_head();
      }
    }