Home › Forums › Front-end Issues › Custom Field Group and how to show it?
Hi Guys im trying to add a custom field group. Basically I have a submit form on http://www.nybygget.dk/tilfoj-byggeri.
This form has specific field groups. The one you see is a “logout” field group.
I would like to have additional fields that is needed on the form. I have tried to register them using this guide:
https://www.advancedcustomfields.com/resources/register-fields-via-php/
And exporting my field group that I want to show.
I took the export code and added to the top of the functions.php, but now im stuck with the documentation?
How do i make it show on the tilfoj-byggeri page?, do I have to call the function inside the template for the page, the template for the page is : Template-property-submit.php
Do I call it with
<?php acf_form(); ?>
I hope someone can help me 🙂 Thank you everyone.
This is the code I added to functions.php no result not showing anywhere, what do I need to do or what dont i understand?
function my_acf_add_local_field_groups() {
acf_add_local_field_group(array (
‘key’ => ‘group_5b013ab0c5a1c’,
‘title’ => ‘Additional Details (prefix field name with “additional_”)’,
‘fields’ => array (
array (
‘key’ => ‘field_5b013aba8f986’,
‘label’ => ‘Bygherre’,
‘name’ => ‘additional_bygherre’,
‘type’ => ‘text’,
‘instructions’ => ”,
‘required’ => 0,
‘conditional_logic’ => 0,
‘wrapper’ => array (
‘width’ => ”,
‘class’ => ”,
‘id’ => ”,
),
‘default_value’ => ”,
‘placeholder’ => ”,
‘prepend’ => ”,
‘append’ => ”,
‘maxlength’ => ”,
),
array (
‘key’ => ‘field_5b013b2b8f991’,
‘label’ => ‘Facebook’,
‘name’ => ‘additional_facebook’,
‘type’ => ‘url’,
‘instructions’ => ‘Link til Facebookside for byggeriet.’,
‘required’ => 0,
‘conditional_logic’ => 0,
‘wrapper’ => array (
‘width’ => ”,
‘class’ => ”,
‘id’ => ”,
),
‘default_value’ => ”,
‘placeholder’ => ”,
),
),
‘location’ => array (
array (
array (
‘param’ => ‘post_type’,
‘operator’ => ‘==’,
‘value’ => ‘property’,
),
array (
‘param’ => ‘current_user’,
‘operator’ => ‘==’,
‘value’ => ‘viewing_back’,
),
),
),
‘menu_order’ => 0,
‘position’ => ‘normal’,
‘style’ => ‘default’,
‘label_placement’ => ‘top’,
‘instruction_placement’ => ‘label’,
‘hide_on_screen’ => ”,
‘active’ => 1,
‘description’ => ”,
));
}
add_action(‘acf/init’, ‘my_acf_add_local_field_groups’);
The topic ‘Custom Field Group and how to show it?’ 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.