add_panel( 'front_page_header', array( 'title' => __( 'Front page section "Header"', 'aniro-hotel-light' ), 'description' => __( 'Front page section "Header" options.', 'aniro-hotel-light' ), 'priority' => 32, ) ); //****************************************************************************** //Add section "Front page header" //****************************************************************************** $wp_customize->add_section( 'front_page_header' , array( 'title' => __( 'Slider', 'aniro-hotel-light' ), 'panel' => 'front_page_header', 'description' => __( 'Slider options.', 'aniro-hotel-light' ) ) ); //****************************************************************************** //Slider's type $wp_customize->add_setting( 'anirohotellight_slider_index_type', array( 'default' => 'type-index-1', 'sanitize_callback' => 'anirohotellight_sanitize_slider_type_index' ) ); $wp_customize->add_control( 'anirohotellight_slider_index_type', array( 'type' => 'radio', 'label' => __( 'Slider type:', 'aniro-hotel-light' ), 'section' => 'front_page_header', 'choices' => array( 'type-index-1' => __( 'Sliding images', 'aniro-hotel-light' ), 'type-index-2' => __( 'Fade images', 'aniro-hotel-light' ) ) ) ); //add color for filtr $wp_customize->add_setting( 'anirohotellight_slider_bg_filtr', array( 'default' => '#000', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize, 'anirohotellight_slider_bg_filtr', array( 'label' => __( 'Select the filter color for the slider images', 'aniro-hotel-light' ), 'section' => 'front_page_header', 'settings' => 'anirohotellight_slider_bg_filtr' ) ) ); //select the transparency for the filter $wp_customize->add_setting( 'anirohotellight_slider_bg_filtr_alpha', array( 'sanitize_callback' => 'anirohotellight_sanitize_float', 'default' => 0, )); $wp_customize->add_control ( 'anirohotellight_slider_bg_filtr_alpha', array( 'type' => 'number', 'label' => __( 'Select the transparency for the filter', 'aniro-hotel-light' ), 'section' => 'front_page_header', 'settings' => 'anirohotellight_slider_bg_filtr_alpha', 'input_attrs' => array( 'min' => 0, 'max' => 1, 'step' => 0.1, 'style' => 'margin-bottom: 15px; padding: 15px;', ), )); /*******************************************************************************************/ $wp_customize->add_setting('anirohotellight-slider-info', array( 'type' => 'info_control', 'sanitize_callback' => 'esc_attr' ) ); $wp_customize->add_control( new Second_Info( $wp_customize, 'anirohotellight-slider-info', array( 'label' => __('Add images and text in slider:', 'aniro-hotel-light'), 'section' => 'front_page_header', 'settings' => 'anirohotellight-slider-info' ) ) ); //For slide 1 /*******************************************************************************************/ $wp_customize->add_setting('anirohotellight-slider-info', array( 'type' => 'info_control', 'sanitize_callback' => 'esc_attr' ) ); $wp_customize->add_control( new Second_Info( $wp_customize, 'anirohotellight-slider-info', array( 'label' => __('Slide 1:', 'aniro-hotel-light'), 'section' => 'front_page_header', 'settings' => 'anirohotellight-slider-info' ) ) ); //Main text $wp_customize->add_setting('anirohotellight_slider_text_1', array( 'default' => '', 'sanitize_callback' => 'anirohotellight_sanitize_text' ) ); $wp_customize->add_control('anirohotellight_slider_text_1', array( 'section' => 'front_page_header', 'label' => 'Text for image in slide 1:', 'type' => 'text' ) ); //Link $wp_customize->add_setting('anirohotellight_slider_link_1', array( 'default' => '', 'sanitize_callback' => 'anirohotellight_sanitize_uri' ) ); $wp_customize->add_control('anirohotellight_slider_link_1', array( 'section' => 'front_page_header', 'label' => 'Button: link for button in slide 1:', 'type' => 'url' ) ); //Link text $wp_customize->add_setting('anirohotellight_slider_link_text_1', array( 'default' => '', 'sanitize_callback' => 'anirohotellight_sanitize_text' ) ); $wp_customize->add_control('anirohotellight_slider_link_text_1', array( 'section' => 'front_page_header', 'label' => 'Button: text for button in slide 1:', 'type' => 'text' ) ); /*********************************************/ // Show/hide button in slider 1 $wp_customize->add_setting('front_page_show_hide_btn_slide_1', array( 'default' => '', 'sanitize_callback' => 'anirohotellight_sanitize_checkbox', )); $wp_customize->add_control('front_page_show_hide_btn_slide_1', array( 'type' => 'checkbox', 'label' => __( 'Hide this button?', 'aniro-hotel-light' ), 'section' => 'front_page_header', ) ); //image $wp_customize->add_setting( 'anirohotellight_slider_img_1', array( 'default-image' => '', 'sanitize_callback' => 'anirohotellight_sanitize_uri', )); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'anirohotellight_slider_img_1', array( 'label' => __( 'Add image 1 - the recommended image size is 1300x500px', 'aniro-hotel-light' ), 'type' => 'image', 'section' => 'front_page_header', 'settings' => 'anirohotellight_slider_img_1', ))); //For slide 2 /*******************************************************************************************/ $wp_customize->add_setting('anirohotellight-slide2-info', array( 'type' => 'info_control', 'sanitize_callback' => 'esc_attr', ) ); $wp_customize->add_control( new Second_Info( $wp_customize, 'anirohotellight-slide2-info', array( 'label' => __('Slide 2:', 'aniro-hotel-light'), 'section' => 'front_page_header', 'settings' => 'anirohotellight-slide2-info', //'priority' => 13 ) ) ); //Text $wp_customize->add_setting('anirohotellight_slider_text_2', array( 'default' => '', 'sanitize_callback' => 'anirohotellight_sanitize_text' ) ); $wp_customize->add_control('anirohotellight_slider_text_2', array( 'section' => 'front_page_header', 'label' => 'Text for image in slide 2:', 'type' => 'text' ) ); //Link $wp_customize->add_setting('anirohotellight_slider_link_2', array( 'default' => '', 'sanitize_callback' => 'anirohotellight_sanitize_uri' ) ); $wp_customize->add_control('anirohotellight_slider_link_2', array( 'section' => 'front_page_header', 'label' => 'Button: link for button in slide 2:', 'type' => 'url' ) ); //Link text $wp_customize->add_setting('anirohotellight_slider_link_text_2', array( 'default' => '', 'sanitize_callback' => 'anirohotellight_sanitize_text' ) ); $wp_customize->add_control('anirohotellight_slider_link_text_2', array( 'section' => 'front_page_header', 'label' => 'Button: text for button in slide 2:', 'type' => 'text' ) ); /*********************************************/ // Show/hide button in slider 2 $wp_customize->add_setting('front_page_show_hide_btn_slide_2', array( 'default' => '', 'sanitize_callback' => 'anirohotellight_sanitize_checkbox', )); $wp_customize->add_control('front_page_show_hide_btn_slide_2', array( 'type' => 'checkbox', 'label' => __( 'Hide this button?', 'aniro-hotel-light' ), 'section' => 'front_page_header', ) ); //image $wp_customize->add_setting( 'anirohotellight_slider_img_2', array( 'default-image' => '', 'sanitize_callback' => 'anirohotellight_sanitize_uri', )); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'anirohotellight_slider_img_2', array( 'label' => __( 'Add image 2 - the recommended image size is 1300x500px', 'aniro-hotel-light' ), 'type' => 'image', 'section' => 'front_page_header', 'settings' => 'anirohotellight_slider_img_2', )));