get_section('header_image')->priority = 12; $wp_customize->get_section( 'header_image' )->title = esc_html__('Banner Options', 'alley-themes'); } add_action( 'customize_register', 'alley_themes_customize_banner_options' ); function alley_themes_customize_banner_options( $wp_customize ) { $wp_customize->add_setting( 'banner_display_in_homepage', array( 'sanitize_callback' => 'alley_themes_sanitize_checkbox', 'default' => false ) ); $wp_customize->add_control( new Alley_Themes_Toggle_Control( $wp_customize, 'banner_display_in_homepage', array( 'label' => esc_html__( 'Hide / Show in Home page','alley-themes' ), 'section' => 'header_image', 'settings' => 'banner_display_in_homepage', 'type'=> 'toggle', ) ) ); $wp_customize->add_setting( 'banner_display_in_otherpage', array( 'sanitize_callback' => 'alley_themes_sanitize_checkbox', 'default' => false ) ); $wp_customize->add_control( new Alley_Themes_Toggle_Control( $wp_customize, 'banner_display_in_otherpage', array( 'label' => esc_html__( 'Hide / Show in other page','alley-themes' ), 'section' => 'header_image', 'settings' => 'banner_display_in_otherpage', 'type'=> 'toggle', ) ) ); $wp_customize->add_setting( 'heading_for_banner', array( 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', 'default' => '' ) ); $wp_customize->add_control( 'heading_for_banner', array( 'label' => esc_html__( 'Enter Heading for Banner', 'alley-themes' ), 'section' => 'header_image', 'settings' => 'heading_for_banner', 'type'=> 'text', ) ); $wp_customize->selective_refresh->add_partial( 'heading_for_banner', array( 'selector' => '.header-background-one .main-title', // You can also select a css class ) ); $wp_customize->add_setting( 'content_for_banner', array( 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_textarea_field', 'transport' => 'postMessage', ) ); $wp_customize->add_control( 'content_for_banner', array( 'label' => esc_html__( 'Enter content for Banner Section', 'alley-themes' ), 'section' => 'header_image', 'settings' => 'content_for_banner', 'type'=> 'textarea', ) ); $wp_customize->selective_refresh->add_partial( 'content_for_banner', array( 'selector' => '.header-background-one p', // You can also select a css class ) ); $wp_customize->add_setting( 'cta_btn1', array( 'default' => '', 'type' => 'customtext', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( new Alley_Themes_Custom_Text( $wp_customize, 'cta_btn1', array( 'label' => esc_html__( 'Cta Button 1 :', 'alley-themes' ), 'section' => 'header_image', 'settings' => 'cta_btn1', ) ) ); $wp_customize->add_setting( 'cta_button1_for_banner', array( 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', 'default' => '' ) ); $wp_customize->add_control( 'cta_button1_for_banner', array( 'label' => esc_html__( 'label', 'alley-themes' ), 'section' => 'header_image', 'settings' => 'cta_button1_for_banner', 'type'=> 'text', ) ); $wp_customize->selective_refresh->add_partial( 'cta_button1_for_banner', array( 'selector' => '.header-background-one .button-group .cta-1', // You can also select a css class ) ); $wp_customize->add_setting( 'cta_button1_link', array( 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( 'cta_button1_link', array( 'label' => esc_html__( 'Link', 'alley-themes' ), 'section' => 'header_image', 'settings' => 'cta_button1_link', 'type'=> 'url', ) ); $wp_customize->add_setting( 'cta_btn2', array( 'default' => '', 'type' => 'customtext', 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( new Alley_Themes_Custom_Text( $wp_customize, 'cta_btn2', array( 'label' => esc_html__( 'Cta Button 2 :', 'alley-themes' ), 'section' => 'header_image', 'settings' => 'cta_btn2', ) ) ); $wp_customize->add_setting( 'cta_button2_for_banner', array( 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', 'default' => '' ) ); $wp_customize->add_control( 'cta_button2_for_banner', array( 'label' => esc_html__( 'label', 'alley-themes' ), 'section' => 'header_image', 'settings' => 'cta_button2_for_banner', 'type'=> 'text', ) ); $wp_customize->selective_refresh->add_partial( 'cta_button2_for_banner', array( 'selector' => '.header-background-one .button-group .cta-2', // You can also select a css class ) ); $wp_customize->add_setting( 'cta_button2_link', array( 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( 'cta_button2_link', array( 'label' => esc_html__( 'Link', 'alley-themes' ), 'section' => 'header_image', 'settings' => 'cta_button2_link', 'type'=> 'url', ) ); $wp_customize->add_setting( 'contact_for_banner', array( 'transport' => 'postMessage', 'sanitize_callback' => 'sanitize_text_field', 'default' => '' ) ); $wp_customize->add_control( 'contact_for_banner', array( 'label' => esc_html__( 'Text Field', 'alley-themes' ), 'section' => 'header_image', 'settings' => 'contact_for_banner', 'type'=> 'text', ) ); $wp_customize->selective_refresh->add_partial( 'contact_for_banner', array( 'selector' => '.header-background-one .call-us', // You can also select a css class ) ); }