Support

Account

Home Forums Front-end Issues File uploader field doesn't appear in front-end if custom post is not published

Solving

File uploader field doesn't appear in front-end if custom post is not published

  • Hi,

    I’m using NRGnetwork theme (with BuddyPress) to make users able to share their projects (like Behance) without using wp admin panel.

    They need to join a ZIP file to their project, that’s why I use acf_form() to display a file uploader custom field. But, when they click on the button to display the new page to create their project post, my file uploader field doesn’t appear (there is only the “Update” button of this field).
    When they publish the post and go back to the editing page, the field of the file uploader is ok and works perfectly.

    Do you know how could I make appear my uploader file field at the first time, when the project post is not published yet ?

  • Hi @sireagroup

    How are you using acf_form()? Do you have it inside another form and set the form parameter to false so it’ll be included in that form instead? Do you have the acf_form_header() function above get_header()?

  • Hi @jonathan

    Yes, acf_form() is used in another form but I don’t understand what do you mean by “set the form parameter to false so it’ll be included in that form instead?” (I’m a beginner)

    Yes I use acf_form_header() above get_header()!

  • acf_form() in itself creates a form so if you do not set it to false you will have a form within a form..

    this is the parameter 'form' => true,

    so acf_form(array('form' => false)) is minimum needed for it to work inside another form. + acf_form_header of course πŸ™‚

  • Thank you @jonathan πŸ™‚

    As you said, now the update button disappeared, but it doesn’t solve my problem about displaying the file uploader when the post is not published yet.

    By the way, now when I publish my post for the first time (whithout file attached because the field wasn’t displayed), and then go back on my post to attach a file and click on my “Save” button, the file selected doesn’t seem to be uploaded, because when I go back to my post edit page, the field is empty.

  • I’d need to see some code to figure out how you set things up πŸ™‚

  • This reply has been marked as private.
  • Hi @jonathan!

    Sorry for double-post..

    Is my message visible for you withe the private option ?

  • Hi @sireagroup

    Sorry I’ve not been able to work the forum for a while πŸ™‚
    Do you still require assistance with this?

    To answer your question, I am able to see your notes, altho it seems you’ve edited out the details now?

  • Yes, I found another way to do it. Thanks for your time πŸ™‚

  • No problem, glad you worked it out!
    Again sorry for taking so long to respond πŸ™‚

    Best of luck in your project!

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

You must be logged in to reply to this topic.