add_panel( 'front_page_services', array( 'title' => __( 'Front page section "Services"', 'aniro-hotel-light' ), 'description' => __( 'Front page section "Services" - options.', 'aniro-hotel-light' ), 'priority' => 38, ) ); //****************************************************************************** //Add section 'Front page services' //****************************************************************************** $wp_customize->add_section( 'front_page_services' , array( 'title' => __( 'Front page services', 'aniro-hotel-light' ), 'panel' => 'front_page_services', 'priority' => 1, 'description' => __( 'Front page services.', 'aniro-hotel-light' ) ) ); /*******************************************************************************************/ //Services Title $wp_customize->add_setting('anirohotellight_services_title', array( 'default' => 'Our services', 'sanitize_callback' => 'anirohotellight_sanitize_text' ) ); $wp_customize->add_control('anirohotellight_services_title', array( 'section' => 'front_page_services', 'label' => 'Title for services:', 'type' => 'text' ) ); /*******************************************************************************************/ //Button text $wp_customize->add_setting('anirohotellight_services_btn_text', array( 'default' => 'See all services', 'sanitize_callback' => 'anirohotellight_sanitize_text' ) ); $wp_customize->add_control('anirohotellight_services_btn_text', array( 'section' => 'front_page_services', 'label' => 'Text for link that will show services', 'type' => 'text' ) ); /*******************************************************************************************/ //Button link $wp_customize->add_setting('anirohotellight_services_btn_link', array( 'default' => '', 'sanitize_callback' => 'anirohotellight_sanitize_uri' ) ); $wp_customize->add_control('anirohotellight_services_btn_link', array( 'section' => 'front_page_services', 'label' => 'Link to services', 'type' => 'url' ) ); //****************************************************************************** //Add section "Services - background" //****************************************************************************** $wp_customize->add_section( 'front_page_services_bg' , array( 'title' => __( 'Services - background', 'aniro-hotel-light' ), 'panel' => 'front_page_services', 'priority' => 1, 'description' => __( 'Add background image for section "Services".', 'aniro-hotel-light' ) ) ); //image $wp_customize->add_setting( 'anirohotellight_services_bg', array( 'default-image' => '', 'sanitize_callback' => 'anirohotellight_sanitize_uri', )); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'anirohotellight_services_bg', array( 'label' => __( 'Add background image for services section - the recommended image size is 1300x500px', 'aniro-hotel-light' ), 'type' => 'image', 'section' => 'front_page_services_bg', 'settings' => 'anirohotellight_services_bg', ))); //add color for filtr $wp_customize->add_setting( 'anirohotellight_services_bg_filtr', array( 'default' => '#d2691e', 'sanitize_callback' => 'sanitize_hex_color', ) ); $wp_customize->add_control( new WP_Customize_Color_Control($wp_customize, 'anirohotellight_services_bg_filtr', array( 'label' => __( 'Select the filter color for the background image', 'aniro-hotel-light' ), 'section' => 'front_page_services_bg', 'settings' => 'anirohotellight_services_bg_filtr' ) ) ); //select the transparency for the filter $wp_customize->add_setting( 'anirohotellight_services_bg_filtr_alpha', array( 'sanitize_callback' => 'anirohotellight_sanitize_float', 'default' => 1, )); $wp_customize->add_control ( 'anirohotellight_services_bg_filtr_alpha', array( 'type' => 'number', 'label' => __( 'Select the transparency for the filter', 'aniro-hotel-light' ), 'section' => 'front_page_services_bg', 'settings' => 'anirohotellight_services_bg_filtr_alpha', 'input_attrs' => array( 'min' => 0, 'max' => 1, 'step' => 0.1, 'style' => 'margin-bottom: 15px; padding: 15px;', ), )); //****************************************************************************** //Add section "Show/hide section" //****************************************************************************** $wp_customize->add_section( 'front_page_show_hide_services_section' , array( 'title' => __( 'Show/hide section', 'aniro-hotel-light' ), 'panel' => 'front_page_services', 'priority' => 100, 'description' => __( 'Show/hide this section.', 'aniro-hotel-light' ) ) ); /*********************************************/ // Show/hide panel with telephone number $wp_customize->add_setting('front_page_show_hide_services', array( 'default' => '', 'sanitize_callback' => 'anirohotellight_sanitize_checkbox', )); $wp_customize->add_control('front_page_show_hide_services', array( 'type' => 'checkbox', 'label' => __( 'Hide this section?', 'aniro-hotel-light' ), 'section' => 'front_page_show_hide_services_section', ) );