Support

Account

Home Forums Front-end Issues Creating frontend page for user post submission

Solved

Creating frontend page for user post submission

  • I’m having a difficult time understanding how to get the form to display in the front end.

    I’ve read http://www.advancedcustomfields.com/resources/tutorials/creating-a-front-end-form/ and http://www.advancedcustomfields.com/resources/tutorials/using-acf_form-to-create-a-new-post/, but I’m still confused.

    Here’s the steps I’ve taken so far.

    1. I have a custom post type setup that I want to have users submit to from the front end.
    2. The custom post type is called “Sites”
    3. I created a field group called “Sites”
    4. I created a Location rule to show the field group “Sites” on ‘Post Type = Sites’
    5. I followed http://www.advancedcustomfields.com/resources/tutorials/using-acf_form-to-create-a-new-post/ and added all code for the my_pre_save_post function and add_action to the functions.php file.
    6. I created a page that uses a template which includes the form code.

    When I go to the page I do not see the form. I only see an “update” button.

    I’ve did a vardump on the $options/$args array and do not find any content.

    So my initial question is, how do I return the field_groups? Have I set something up wrong in the location rules or something else?

  • OK, so I’m able to get the form to show up now.

    One key detail that is left out of the tutorial is to go to the Field Groups form and hover over the link to get the post id for the Field Group. That is what needs to be put in the field_groups array.

    For example: My field group post ID was 96 so my code looks like this:

    <?php 
         $options = array('post_id' => 'new', 'field_groups' => array(96));  
         acf_form($options);
     ?> 
Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Creating frontend page for user post submission’ is closed to new replies.