add_section( 'balen_hero_banner_section', array( 'title' => esc_html__( 'Hero Banner','balen' ), 'description' => esc_html__( 'Hero Banner Section options.', 'balen' ), 'panel' => 'balen_front_page_panel', ) ); // Hero Banner content enable control and setting $wp_customize->add_setting( 'balen_theme_options[hero_banner_section_enable]', array( 'default' => $options['hero_banner_section_enable'], 'sanitize_callback' => 'balen_sanitize_switch_control', ) ); $wp_customize->add_control( new Balen_Switch_Control( $wp_customize, 'balen_theme_options[hero_banner_section_enable]', array( 'label' => esc_html__( 'Hero Banner Section Enable', 'balen' ), 'section' => 'balen_hero_banner_section', 'on_off_label' => balen_switch_options(), ) ) ); // Hero Banner content enable control and setting $wp_customize->add_setting( 'balen_theme_options[hero_banner_social_menu_enable]', array( 'default' => $options['hero_banner_social_menu_enable'], 'sanitize_callback' => 'balen_sanitize_switch_control', ) ); $wp_customize->add_control( new Balen_Switch_Control( $wp_customize, 'balen_theme_options[hero_banner_social_menu_enable]', array( 'label' => esc_html__( 'Enable Social Menu', 'balen' ), 'section' => 'balen_hero_banner_section', 'on_off_label' => balen_switch_options(), ) ) ); // hero_banner_sub title setting and control $wp_customize->add_setting( 'balen_theme_options[hero_banner_title]', array( 'default' => $options['hero_banner_title'], 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'balen_theme_options[hero_banner_title]', array( 'label' => esc_html__( 'Section Title', 'balen' ), 'description' => esc_html__( 'Separate the two words with space', 'balen' ), 'section' => 'balen_hero_banner_section', 'type' => 'text', 'active_callback' => 'balen_is_hero_banner_section_enable', ) ); // // Abort if selective refresh is not available. // if ( isset( $wp_customize->selective_refresh ) ) { // $wp_customize->selective_refresh->add_partial( 'balen_theme_options[hero_banner_title]', // array( // 'selector' => '#balen_header_content_section .section-header span', // 'settings' => 'balen_theme_options[hero_banner_title]', // 'container_inclusive' => false, // 'fallback_refresh' => true, // 'render_callback' => 'balen_hero_banner_title_partial', // ) // ); // } // hero_banner_sub title setting and control $wp_customize->add_setting( 'balen_theme_options[hero_banner_dob]', array( 'default' => $options['hero_banner_dob'], 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'balen_theme_options[hero_banner_dob]', array( 'label' => esc_html__( 'Date Of Birth', 'balen' ), 'section' => 'balen_hero_banner_section', 'type' => 'text', 'active_callback' => 'balen_is_hero_banner_section_enable', ) ); // Abort if selective refresh is not available. if ( isset( $wp_customize->selective_refresh ) ) { $wp_customize->selective_refresh->add_partial( 'balen_theme_options[hero_banner_dob]', array( 'selector' => '#balen_header_content_section .entry-meta span', 'settings' => 'balen_theme_options[hero_banner_dob]', 'container_inclusive' => false, 'fallback_refresh' => true, 'render_callback' => 'balen_hero_banner_dob_partial', ) ); } // hero_banner_sub title setting and control $wp_customize->add_setting( 'balen_theme_options[hero_banner_dob_title]', array( 'default' => $options['hero_banner_dob_title'], 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'balen_theme_options[hero_banner_dob_title]', array( 'label' => esc_html__( 'Date Of Birth Title', 'balen' ), 'section' => 'balen_hero_banner_section', 'type' => 'text', 'active_callback' => 'balen_is_hero_banner_section_enable', ) ); // Abort if selective refresh is not available. if ( isset( $wp_customize->selective_refresh ) ) { $wp_customize->selective_refresh->add_partial( 'balen_theme_options[hero_banner_dob_title]', array( 'selector' => '#balen_header_content_section .entry-meta p', 'settings' => 'balen_theme_options[hero_banner_dob_title]', 'container_inclusive' => false, 'fallback_refresh' => true, 'render_callback' => 'balen_hero_banner_dob_title_partial', ) ); } // hero_banner posts drop down chooser control and setting $wp_customize->add_setting( 'balen_theme_options[hero_banner_content_page]', array( 'sanitize_callback' => 'balen_sanitize_page', ) ); $wp_customize->add_control( new Balen_Dropdown_Chooser( $wp_customize, 'balen_theme_options[hero_banner_content_page]', array( 'label' => esc_html__( 'Select Page', 'balen'), 'section' => 'balen_hero_banner_section', 'choices' => balen_page_choices(), 'active_callback' => 'balen_is_hero_banner_section_enable', ) ) ); //hero_banner separator $wp_customize->add_setting('balen_theme_options[hero_banner_separator]', array( 'sanitize_callback' => 'balen_sanitize_html', ) ); $wp_customize->add_control(new Balen_Customize_Horizontal_Line($wp_customize, 'balen_theme_options[hero_banner_separator]', array( 'active_callback' => 'balen_is_hero_banner_section_enable', 'type' =>'hr', 'section' =>'balen_hero_banner_section', ) ) ); // about btn title setting and control $wp_customize->add_setting( 'balen_theme_options[hero_banner_content_title]', array( 'default' => $options['hero_banner_content_title'], 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'balen_theme_options[hero_banner_content_title]', array( 'label' => esc_html__( 'Content Title', 'balen' ), 'section' => 'balen_hero_banner_section', 'active_callback' => 'balen_is_hero_banner_section_enable', 'type' => 'text', ) ); // Abort if selective refresh is not available. if ( isset( $wp_customize->selective_refresh ) ) { $wp_customize->selective_refresh->add_partial( 'balen_theme_options[hero_banner_content_title]', array( 'selector' => '#balen_business_about_us .entry-header h2', 'settings' => 'balen_theme_options[hero_banner_content_title]', 'container_inclusive' => false, 'fallback_refresh' => true, 'render_callback' => 'balen_hero_banner_content_title_partial', ) ); } // Add dropdown categories setting and control. $wp_customize->add_setting( 'balen_theme_options[hero_banner_content_multitple_page]', array( 'sanitize_callback' => 'balen_sanitize_page_list', ) ); $wp_customize->add_control( new Balen_Dropdown_Multiple_Chooser( $wp_customize, 'balen_theme_options[hero_banner_content_multitple_page]', array( 'label' => esc_html__( 'Select Multiple Page', 'balen' ), 'section' => 'balen_hero_banner_section', 'type' => 'dropdown_multiple_chooser', 'choices' => balen_page_choices(), 'active_callback' => 'balen_is_hero_banner_section_enable' ) ) ); //hero_banner_btn_txt $wp_customize->add_setting('balen_theme_options[hero_banner_know_more_txt]', array( 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', 'default' => $options['hero_banner_know_more_txt'], ) ); $wp_customize->add_control('balen_theme_options[hero_banner_know_more_txt]', array( 'section' => 'balen_hero_banner_section', 'label' => esc_html__( 'know More Text:', 'balen' ), 'type' =>'text', 'active_callback' => 'balen_is_hero_banner_section_enable' ) ); // Abort if selective refresh is not available. if ( isset( $wp_customize->selective_refresh ) ) { $wp_customize->selective_refresh->add_partial( 'balen_theme_options[hero_banner_know_more_txt]', array( 'selector' => '#balen_header_content_section .scroll span', 'settings' => 'balen_theme_options[hero_banner_know_more_txt]', 'fallback_refresh' => true, 'container_inclusive' => false, 'render_callback' => 'balen_hero_banner_know_more_txt_partial', ) ); } //hero_banner_btn_txt $wp_customize->add_setting('balen_theme_options[hero_banner_btn_txt]', array( 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', 'default' => $options['hero_banner_btn_txt'], ) ); $wp_customize->add_control('balen_theme_options[hero_banner_btn_txt]', array( 'section' => 'balen_hero_banner_section', 'label' => esc_html__( 'Scroll Down Button Text:', 'balen' ), 'type' =>'text', 'active_callback' => 'balen_is_hero_banner_section_enable' ) ); // Abort if selective refresh is not available. if ( isset( $wp_customize->selective_refresh ) ) { $wp_customize->selective_refresh->add_partial( 'balen_theme_options[hero_banner_btn_txt]', array( 'selector' => '#balen_header_content_section .scroll a > span', 'settings' => 'balen_theme_options[hero_banner_btn_txt]', 'fallback_refresh' => true, 'container_inclusive' => false, 'render_callback' => 'balen_hero_banner_btn_txt_partial', ) ); } // hero_banner Excerpt length setting and control. $wp_customize->add_setting( 'balen_theme_options[hero_banner_excerpt_length]', array( 'sanitize_callback' => 'balen_sanitize_number_range', 'default' => $options['hero_banner_excerpt_length'], ) ); $wp_customize->add_control( 'balen_theme_options[hero_banner_excerpt_length]', array( 'label' => esc_html__( 'Excerpt Length', 'balen' ), 'description' => esc_html__( 'Total words to be displayed in hero banner section', 'balen' ), 'section' => 'balen_hero_banner_section', 'type' => 'number', 'active_callback' => 'balen_is_hero_banner_section_enable', ) );