From 3a0ae9636d38204134e735b05761fcb93d8f99ba Mon Sep 17 00:00:00 2001 From: Malte Date: Sat, 15 Aug 2020 21:25:29 +0200 Subject: [PATCH] acf auto fields??? --- themes/argo/functions.php | 166 +++++++++++++++++++++++++++++++++++++- 1 file changed, 164 insertions(+), 2 deletions(-) diff --git a/themes/argo/functions.php b/themes/argo/functions.php index 3fac7a4..af1163f 100644 --- a/themes/argo/functions.php +++ b/themes/argo/functions.php @@ -189,5 +189,167 @@ function argo_scripts() { * Advanced Custom Fields Fields */ -require get_template_directory() . '/inc/acf-fields.php'; - \ No newline at end of file +// require get_template_directory() . '/inc/acf-fields.php'; +if( function_exists('acf_add_local_field_group') ): + + // Homepage Fieldgroup +acf_add_local_field_group(array( + 'key' => 'group_5f22b8231f9e7', + 'title' => 'Homepage', + 'fields' => array( + array( + 'key' => 'field_5f22b8280fa17', + 'label' => 'Intro Text', + 'name' => 'intro_text', + 'type' => 'text', + 'instructions' => 'Der erste Text, den der Nutzer sieht', + 'required' => 1, + 'conditional_logic' => 0, + 'wrapper' => array( + 'width' => '', + 'class' => '', + 'id' => '', + ), + 'default_value' => 'Wir sind krass.', + 'placeholder' => '', + 'prepend' => '', + 'append' => '', + 'maxlength' => '', + ), + array( + 'key' => 'field_5f328ac14f4ee', + 'label' => 'Testimonials', + 'name' => 'testimonials', + 'type' => 'repeater', + 'instructions' => 'Hier die Testimonials eintragen', + 'required' => 1, + 'conditional_logic' => 0, + 'wrapper' => array( + 'width' => '', + 'class' => '', + 'id' => '', + ), + 'collapsed' => 'field_5f328ae34f4ef', + 'min' => 1, + 'max' => 8, + 'layout' => 'table', + 'button_label' => 'Testimonial hinzufügen', + 'sub_fields' => array( + array( + 'key' => 'field_5f328ae34f4ef', + 'label' => 'Einzelnes Testimonial', + 'name' => 'testimonial', + 'type' => 'group', + 'instructions' => '', + 'required' => 0, + 'conditional_logic' => 0, + 'wrapper' => array( + 'width' => '', + 'class' => '', + 'id' => '', + ), + 'layout' => 'row', + 'sub_fields' => array( + array( + 'key' => 'field_5f328b054f4f0', + 'label' => 'Name', + 'name' => 'name', + 'type' => 'text', + 'instructions' => '', + 'required' => 0, + 'conditional_logic' => 0, + 'wrapper' => array( + 'width' => '', + 'class' => '', + 'id' => '', + ), + 'default_value' => '', + 'placeholder' => 'Max Mustermann', + 'prepend' => '', + 'append' => '', + 'maxlength' => '', + ), + array( + 'key' => 'field_5f328b274f4f1', + 'label' => 'Text', + 'name' => 'text', + 'type' => 'textarea', + 'instructions' => '', + 'required' => 0, + 'conditional_logic' => 0, + 'wrapper' => array( + 'width' => '', + 'class' => '', + 'id' => '', + ), + 'default_value' => '', + 'placeholder' => 'Spacifik ist cool weil...', + 'maxlength' => '', + 'rows' => '', + 'new_lines' => '', + ), + array( + 'key' => 'field_5f3291370357e', + 'label' => 'Profilbild', + 'name' => 'profilbild', + 'type' => 'image', + 'instructions' => '', + 'required' => 0, + 'conditional_logic' => 0, + 'wrapper' => array( + 'width' => '', + 'class' => '', + 'id' => '', + ), + 'return_format' => 'array', + 'preview_size' => 'medium', + 'library' => 'all', + 'min_width' => '', + 'min_height' => '', + 'min_size' => '', + 'max_width' => '', + 'max_height' => '', + 'max_size' => '', + 'mime_types' => '', + ), + array( + 'key' => 'field_5f328b414f4f2', + 'label' => 'LinkedIn Link', + 'name' => 'linkedin_link', + 'type' => 'url', + 'instructions' => '', + 'required' => 0, + 'conditional_logic' => 0, + 'wrapper' => array( + 'width' => '', + 'class' => '', + 'id' => '', + ), + 'default_value' => '', + 'placeholder' => '', + ), + ), + ), + ), + ), + ), + 'location' => array( + array( + array( + 'param' => 'page', + 'operator' => '==', + 'value' => '6', + ), + ), + ), + 'menu_order' => 0, + 'position' => 'acf_after_title', + 'style' => 'seamless', + 'label_placement' => 'left', + 'instruction_placement' => 'label', + 'hide_on_screen' => '', + 'active' => true, + 'description' => '', +)); + +endif; \ No newline at end of file