Support

Account

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