Support

Account

Home Forums ACF PRO Setting up a form for each field group

Solving

Setting up a form for each field group

  • Hello, I hope someone can guide me.

    I am customizing a theme that came with ACF Pro (which after working with for a while now I intend to purchase for myself in the near future). I have been able to figure out pretty much everything I want to do so far through the tutorials, documentation, and trial and error.

    But I cannot figure out how to put up multiple forms on my site using acf_form(). I can certainly set one up with standard HTML, but I would prefer it to grab all the fields in the field group without all the coding.

    The theme came with coding for one form, calling acf_form() from a template, and I see all the options for the form in the api_template.php. I need this form to stay as is.

    In addition, I need to be able to create more forms and I have not found yet any clear instruction on how to do it.
    I am hoping someone in the community can guide me step by step, telling me to do this and that and what extra coding I need to go where.

    Appreciate the guidance and look forward to giving back to the community myself in the future.

  • Hi @avabiz

    The acf_form() function is, as you probably figured out, not specific to your theme but an ACF function to create forms in the frontend.

    From the sound of how you go about things i suspect you’re not comfortable with coding a childtheme. Usually acf_form requires to be inserted manually in your themes templates.

    However I just recently created a small addon which allows you to create forms using shortcodes in the editor.
    https://github.com/jonathan-dejong/acf-form-shortcode

    Using that you can create forms for whatever group you want and put them wherever in your editor.

  • Hi Jonathan,

    Thanks for your feedback.

    Yes I do understand that calling the acf_form() is not specific to my theme. And while I am very comfortable creating child themes, I have not been able to figure out how to use the acf_form() to create the multiple forms I need.

    I will definitely check out your addon and see if that will help speed up the process for me. Thanks for that.

    I am still hoping that I can get some clearer instructions as well on how to create these extra forms. I have been searching for many days now for tutorials, documentation and the like for that.

  • Further, I need the calls to the forms to go right in the template and not in the page/post editor.

  • hm okay.

    Well to create multiple forms you should be able to just add multiple instances of acf_form() to your template.
    Also make sure you add acf_form_head() above get_head().

    You should be able to find all you need here:
    https://www.advancedcustomfields.com/resources/acf_form/

    Note that you might want to change up the form ID for each form to avoid collisions.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.