add_panel( 'bansta_panel_header', [ 'title' => __('Header', 'bansta'), 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'priority' => 28 ]); $wp_customize->add_section( 'bansta_branding_section', [ 'title' => __( 'Site Branding', 'bansta' ), 'panel' => 'bansta_panel_header', 'priority' => 10 ]); $wp_customize->add_setting( 'logo_size', [ 'default' => $bansta_defaults['logo_size'], 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'transport' => 'postMessage', 'sanitize_callback' => 'absint' ] ); $wp_customize->add_control( 'logo_size', [ 'type' => 'number', 'settings' => 'logo_size', 'priority' => 8, 'label' => esc_html__('Logo Size', 'bansta'), 'section' => 'bansta_branding_section', 'input_attrs' => [ 'min' => 10, 'max' => 150, 'step' => 4 ] ] ); $wp_customize->add_section( 'bansta_header_layout_section', [ 'title' => __( 'Header Styles', 'bansta' ), 'panel' => 'bansta_panel_header', 'priority' => 23, ]); //Header layout $wp_customize->add_setting( 'bansta_header_part', [ 'default' => $bansta_defaults['bansta_header_part'], 'capability' => 'edit_theme_options', 'type' => 'theme_mod', 'sanitize_callback' => 'bansta_sanitize_select', 'transport' => 'refresh', ]); $wp_customize->add_control( 'bansta_header_part', [ 'label' => __('Select Header', 'bansta'), 'settings' => 'bansta_header_part', 'section' => 'bansta_header_layout_section', 'type' => 'select', 'choices' => [ 'default' => __('Default', 'bansta'), 'style-2' => __('Style-2', 'bansta'), 'style-3' => __('Style-3', 'bansta'), 'style-4' => __('Off-Canvas', 'bansta'), 'style-5' => __('Off-Canvas full', 'bansta' ) ] ]); $wp_customize->add_setting( 'main_menu_direction', [ 'default' => $bansta_defaults['main_menu_direction'], 'capability' => 'edit_theme_options', 'type' => 'theme_mod', 'sanitize_callback' => 'bansta_sanitize_select' ]); $wp_customize->add_control( 'main_menu_direction', [ 'label' => __( 'Menu position', 'bansta' ), 'settings' => 'main_menu_direction', 'section' => 'bansta_header_layout_section', 'type' => 'radio', 'choices' => [ 'left' => __( 'Left', 'bansta' ), 'center' => __( 'Center', 'bansta' ), 'right' => __( 'right', 'bansta' ) ], 'active_callback' => fn() => get_theme_mod( 'bansta_header_part' ) === 'default' || get_theme_mod( 'bansta_header_part' ) === 'style-2' || get_theme_mod( 'bansta_header_part' ) === 'style-4' ]); //Logo align $wp_customize->add_setting( 'bansta_logo_align', [ 'default' => $bansta_defaults['bansta_logo_align'], 'capability' => 'edit_theme_options', 'type' => 'theme_mod', 'sanitize_callback' => 'bansta_sanitize_select', 'transport' => 'refresh', ]); $wp_customize->add_control( 'bansta_logo_align', [ 'label' => __('Logo alignment', 'bansta'), 'settings' => 'bansta_logo_align', 'section' => 'bansta_header_layout_section', 'type' => 'select', 'choices' => [ 'default' => __('Default', 'bansta'), 'center' => __('Center', 'bansta'), ], 'active_callback' => fn() => get_theme_mod( 'bansta_header_part' ) === 'style-2' || get_theme_mod( 'bansta_header_part' ) === 'style-3' ]); $wp_customize->add_setting( 'bansta_header_style', [ 'default' => $bansta_defaults['bansta_header_style'], 'capability' => 'edit_theme_options', 'type' => 'theme_mod', 'sanitize_callback' => 'bansta_sanitize_select', 'transport' => 'refresh' ]); $wp_customize->add_control( 'bansta_header_style', [ 'label' => __( 'Header Style', 'bansta' ), 'settings' => 'bansta_header_style', 'section' => 'bansta_header_layout_section', 'type' => 'select', 'choices' => [ 'default' => esc_html__( 'default', 'bansta' ), 'transparent' => esc_html__( 'Transparent', 'bansta' ) ], ]); //Menu icon color $wp_customize->add_setting( 'bansta_menu_icon', [ 'default' => $bansta_defaults[ 'bansta_menu_icon' ], 'capability' => 'edit_theme_options', 'type' => 'theme_mod', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', ]); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'bansta_menu_icon', [ 'label' => __('Menu icon color', 'bansta'), 'settings' => 'bansta_menu_icon', 'section' => 'bansta_header_layout_section', ])); //Main Nav links color $wp_customize->add_setting( 'main_nav_link_color', [ 'default' => $bansta_defaults[ 'main_nav_link_color' ], 'capability' => 'edit_theme_options', 'type' => 'theme_mod', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', ]); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'main_nav_link_color', [ 'label' => __('Main Nav links color', 'bansta'), 'settings' => 'main_nav_link_color', 'section' => 'bansta_header_layout_section', ])); //Header background image $wp_customize->add_setting( 'header-background-image', [ 'capability' => 'edit_theme_options', 'type' => 'theme_mod', 'sanitize_callback' => 'esc_url_raw', 'transport' => 'postMessage', ]); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'header-background-image', [ 'label' => __('Header background image', 'bansta'), 'settings' => 'header-background-image', 'section' => 'bansta_header_layout_section', ])); $wp_customize->add_setting( 'header-background-image-size', [ 'default' => $bansta_defaults['header-background-image-size'], 'capability' => 'edit_theme_options', 'type' => 'theme_mod', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ] ); $wp_customize->add_control( 'header-background-image-size', [ 'label' => __('background-size', 'bansta'), 'settings' => 'header-background-image-size', 'section' => 'bansta_header_layout_section', 'type' => 'text' ]); $wp_customize->add_setting( 'header-background-image-position', [ 'default' => $bansta_defaults['header-background-image-position'], 'capability' => 'edit_theme_options', 'type' => 'theme_mod', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage', ] ); $wp_customize->add_control( 'header-background-image-position', [ 'label' => __('background-position:', 'bansta'), 'settings' => 'header-background-image-position', 'section' => 'bansta_header_layout_section', 'type' => 'text' ]); //Main Nav $wp_customize->add_section( 'bansta_main_nav', [ 'title' => __( 'Main Nav', 'bansta' ), 'panel' => 'bansta_panel_header', 'priority' => 33, ]); //Top Nav $wp_customize->add_section( 'bansta_top_header', [ 'title' => __( 'Top Nav', 'bansta' ), 'panel' => 'bansta_panel_header', 'priority' => 33, ]); $wp_customize->add_setting( 'bansta_top_nav', [ 'default' => true, 'capability' => 'edit_theme_options', 'type' => 'theme_mod', 'sanitize_callback' => 'bansta_sanitize_checkbox', 'transport' => 'refresh', ]); $wp_customize->add_control( new Ts_Toggle_Control( $wp_customize, 'bansta_top_nav', [ 'label' => esc_html__('Show/Hide Top Nav', 'bansta'), 'section' => 'bansta_top_header', 'settings' => 'bansta_top_nav', 'type' => 'toggle', 'active_callback' => fn()=> get_theme_mod( 'bansta_header_part' ) !== 'style-5' ])); $wp_customize->add_setting( 'show_hide_top_social', [ 'default' => true, 'capability' => 'edit_theme_options', 'type' => 'theme_mod', 'sanitize_callback' => 'bansta_sanitize_checkbox', 'transport' => 'refresh', ]); $wp_customize->add_control( new Ts_Toggle_Control( $wp_customize, 'show_hide_top_social', [ 'label' => esc_html__('Show/Hide Top Social', 'bansta'), 'section' => 'bansta_top_header', 'settings' => 'show_hide_top_social', 'type' => 'toggle', 'active_callback' => fn() => get_theme_mod( 'bansta_top_nav', true ) ])); $wp_customize->add_setting( 'top_nav_icon_color', [ 'default' => $bansta_defaults['top_nav_icon_color'], 'capability' => 'edit_theme_options', 'type' => 'theme_mod', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'PostMessage' ]); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'top_nav_icon_color', [ 'label' => esc_html__( 'Icons color', 'bansta' ), 'section' => 'bansta_top_header', 'settings' => 'top_nav_icon_color', 'active_callback' => fn() => get_theme_mod( 'bansta_top_nav' ) === true && get_theme_mod( 'show_hide_top_social' ) ])); $wp_customize->add_setting( 'fb_top_social', [ 'default' => $bansta_defaults['fb_top_social'], 'capability' => 'edit_theme_options', 'type' => 'theme_mod', 'sanitize_callback' => 'sanitize_url', 'transport' => 'refresh', ] ); $wp_customize->add_control( 'fb_top_social', [ 'label' => __('Facebook', 'bansta'), 'settings' => 'fb_top_social', 'section' => 'bansta_top_header', 'type' => 'url', 'active_callback' => fn() => get_theme_mod( 'show_hide_top_social' ) === true && get_theme_mod( 'bansta_top_nav' ) === true ]); $wp_customize->add_setting( 'x_top_social', [ 'default' => $bansta_defaults['x_top_social'], 'capability' => 'edit_theme_options', 'type' => 'theme_mod', 'sanitize_callback' => 'sanitize_url', 'transport' => 'refresh', ] ); $wp_customize->add_control( 'x_top_social', [ 'label' => __('X', 'bansta'), 'settings' => 'x_top_social', 'section' => 'bansta_top_header', 'type' => 'url', 'active_callback' => fn() => get_theme_mod( 'show_hide_top_social' ) === true && get_theme_mod( 'bansta_top_nav' ) === true ]); $wp_customize->add_setting( 'insta_top_social', [ 'default' => $bansta_defaults['insta_top_social'], 'capability' => 'edit_theme_options', 'type' => 'theme_mod', 'sanitize_callback' => 'sanitize_url', 'transport' => 'refresh', ] ); $wp_customize->add_control( 'insta_top_social', [ 'label' => __('Instagram', 'bansta'), 'settings' => 'insta_top_social', 'section' => 'bansta_top_header', 'type' => 'url', 'active_callback' => fn() => get_theme_mod( 'show_hide_top_social' ) === true && get_theme_mod( 'bansta_top_nav' ) === true ]); $wp_customize->add_setting( 'pin_top_social', [ 'default' => $bansta_defaults['pin_top_social'], 'capability' => 'edit_theme_options', 'type' => 'theme_mod', 'sanitize_callback' => 'sanitize_url', 'transport' => 'refresh', ] ); $wp_customize->add_control( 'pin_top_social', [ 'label' => __('Pinterest', 'bansta'), 'settings' => 'pin_top_social', 'section' => 'bansta_top_header', 'type' => 'url', 'active_callback' => fn() => get_theme_mod( 'show_hide_top_social' ) === true && get_theme_mod( 'bansta_top_nav' ) === true ]); $wp_customize->add_setting( 'in_top_social', [ 'default' => $bansta_defaults['in_top_social'], 'capability' => 'edit_theme_options', 'type' => 'theme_mod', 'sanitize_callback' => 'sanitize_url', 'transport' => 'refresh', ] ); $wp_customize->add_control( 'in_top_social', [ 'label' => __('Linkedin', 'bansta'), 'settings' => 'in_top_social', 'section' => 'bansta_top_header', 'type' => 'url', 'active_callback' => fn() => get_theme_mod( 'show_hide_top_social' ) === true && get_theme_mod( 'bansta_top_nav' ) === true ]);