Support

Account

Home Forums Front-end Issues Custom Field Group and how to show it? Reply To: Custom Field Group and how to show it?

  • 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’);