Home › Forums › Front-end Issues › Not show some fields in front end form
Hello,
I try to show a front end form with acf_form() but I need to hide some speciffic fields.
<?php
$options = array(
'fields' => array(
array(
'key' => 'field_57bd818860053'
)
),
'submit_value' => 'Crear anuncio'
);
acf_form($options);
?>
How do I hide a field?
You can’t hide a field, what you need to do is list all the fields that you want to show in the ‘fields’ argument.
Thanks John,
where can I see an example of this? I see in the documentation https://www.advancedcustomfields.com/resources/acf_form/#overview but I don’t know how to list the fields I want to show in the array.
Thx!!
There are no example of this. Your OP has what you need, you simply need to list every field that you want to include in the form in the fields
array.
Maybe you mean where to you get the fields keys from. Go into the page to edit the field group, under page options check the “show field keys” option. Copy the field keys from there.
Thanks John,
This is my code, following your instructions, but I don’t get it to work. All fields are shown.
<?php
$options = array(
'fields' => array(
'field_57624bf5aaf38',
'field_57bd81ca68524',
'field_57bd8deef084b'
),
'submit_value' => 'Crear anuncio'
);
acf_form($options);
?>
Do I need any other elements in the array? Any clue?
Thanks a lot!
ACF 4 does not include the fields
option. The correct documentation for acf_form()
in ACF 4 is here https://www.advancedcustomfields.com/resources/acf_form/?version=4.
You cannot do what you are trying to do with ACF4.
If this is really something you need then yes, the only way you’ll do it is if you switch to ACF5.
As my plugin is up to date I conclude that ACF5 is PRO version isnt it?
Thanks a lot!
😉
Yes, ACF5 is only available in the Pro version at this time.
Hi John, greatings from Brazil!
I have some issues in frontend too… I use theme and childtheme (ClassiPress) and the “Register” template don’t show the fields I create in frontend.
Can you help with that?
My website is: http://www.imoveisfacil.net
The topic ‘Not show some fields in front end form’ is closed to new replies.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.