add_panel( 'bansta_layout_panel', [ 'title' => __( 'Layout', 'bansta' ), 'type' => 'theme_mod', 'capability' => 'edit_theme_options', 'priority' => 26 ]); //Color $wp_customize->add_section( 'bansta_background_section', [ 'title' => __( 'Color', 'bansta' ), 'panel' => 'bansta_layout_panel', 'priority' => 13 ]); //Site identity color $wp_customize->add_setting( 'site_identity_color', [ 'default' => $bansta_defaults[ 'site_identity_color' ], 'capability' => 'edit_theme_options', 'type' => 'get_theme_mod', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'postMessage', 'priority' => 13 ]); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'site_identity_color', [ 'label' => __('Site title color', 'bansta'), 'settings' => 'site_identity_color', 'section' => 'title_tagline', ])); //Background color $wp_customize->add_setting( 'bansta_background_color', [ 'default' => $bansta_defaults[ 'bansta_background_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, 'bansta_background_color', [ 'label' => __('Background color', 'bansta'), 'settings' => 'bansta_background_color', 'section' => 'bansta_background_section', ])); //Primary color $wp_customize->add_setting( 'bansta_primary_color', [ 'default' => $bansta_defaults[ 'bansta_primary_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, 'bansta_primary_color', [ 'label' => __('Primary color', 'bansta'), 'settings' => 'bansta_primary_color', 'section' => 'bansta_background_section', 'inner-options' => [ ] ])); //Secondary color $wp_customize->add_setting( 'bansta_secondary_color', [ 'default' => $bansta_defaults[ 'bansta_secondary_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, 'bansta_secondary_color', [ 'label' => __('Secondary color', 'bansta'), 'settings' => 'bansta_secondary_color', 'section' => 'bansta_background_section', ])); //header background color $wp_customize->add_setting( 'header_background_color', [ 'default' => $bansta_defaults[ 'header_background_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, 'header_background_color', [ 'label' => __('Header color', 'bansta'), 'settings' => 'header_background_color', 'section' => 'bansta_background_section', ])); //Top nav background color $wp_customize->add_setting( 'topnav_background_color', [ 'default' => $bansta_defaults[ 'topnav_background_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, 'topnav_background_color', [ 'label' => __('Top nav color', 'bansta'), 'settings' => 'topnav_background_color', 'section' => 'bansta_background_section', ])); //Main nav background color $wp_customize->add_setting( 'mainnav_background_color', [ 'default' => $bansta_defaults[ 'mainnav_background_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, 'mainnav_background_color', [ 'label' => __('Main nav color', 'bansta'), 'settings' => 'mainnav_background_color', 'section' => 'bansta_background_section', 'active_callback' => fn()=> get_theme_mod( 'bansta_header_part' ) === 'style-2' || get_theme_mod( 'bansta_header_part' ) === 'style-3' ])); //Link color $wp_customize->add_setting( 'bansta_link_color', [ 'default' => $bansta_defaults[ 'bansta_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, 'bansta_link_color', [ 'label' => __('Link color', 'bansta'), 'settings' => 'bansta_link_color', 'section' => 'bansta_background_section', ])); //Link:hover color $wp_customize->add_setting( 'bansta_link_hover_color', [ 'default' => $bansta_defaults[ 'bansta_link_hover_color' ], 'capability' => 'edit_theme_options', 'type' => 'theme_mod', 'sanitize_callback' => 'sanitize_hex_color', 'transport' => 'refresh', ]); $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'bansta_link_hover_color', [ 'label' => __('Link hover color', 'bansta'), 'settings' => 'bansta_link_hover_color', 'section' => 'bansta_background_section', ])); //Content color $wp_customize->add_setting( 'bansta_content_color', [ 'default' => $bansta_defaults[ 'bansta_content_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, 'bansta_content_color', [ 'label' => __('Content color', 'bansta'), 'settings' => 'bansta_content_color', 'section' => 'bansta_background_section', ])); //Layout Section $wp_customize->add_section( 'bansta_layout_section', [ 'title' => esc_html__('Container Size', 'bansta'), 'panel' => 'bansta_layout_panel', 'priority' => 21 ] ); //Background image $wp_customize->add_setting( 'bansta-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, 'bansta-background-image', [ 'label' => __('Background image', 'bansta'), 'settings' => 'bansta-background-image', 'section' => 'bansta_layout_section', ])); $wp_customize->add_setting( 'container_layout_size', [ 'sanitize_callback' => 'bansta_sanitize_select', 'default' => $bansta_defaults['container_layout_size'], 'type' => 'theme_mod', 'capability' => 'edit_theme_options', ] ); $wp_customize->add_control( 'container_layout_size', [ 'label' => esc_html__('Container Size', 'bansta'), 'settings' => 'container_layout_size', 'type' => 'select', 'section' => 'bansta_layout_section', 'choices' => [ 'boxed' => __( 'Boxed', 'bansta' ), 'stretched' => __( 'Stretched', 'bansta' ) ] ] ); $wp_customize->add_setting( 'header_layout_size', [ 'sanitize_callback' => 'absint', 'default' => $bansta_defaults['header_layout_size'], 'type' => 'theme_mod', 'capability' => 'edit_theme_options', ] ); $wp_customize->add_control( 'header_layout_size', [ 'settings' => 'header_layout_size', 'type' => 'number', 'section' => 'bansta_layout_section', 'label' => esc_html__('Header Size', 'bansta'), 'input_attrs' => [ 'min' => 1000, 'max' => 1600, 'step' => 10 ] ] ); $wp_customize->add_setting( 'grid_layout_size', [ 'sanitize_callback' => 'absint', 'default' => $bansta_defaults['grid_layout_size'], 'type' => 'theme_mod', 'capability' => 'edit_theme_options', ] ); $wp_customize->add_control( 'grid_layout_size', [ 'settings' => 'grid_layout_size', 'type' => 'number', 'section' => 'bansta_layout_section', 'label' => esc_html__('Grid Size', 'bansta'), 'input_attrs' => [ 'min' => 1000, 'max' => 1600, 'step' => 10 ] ] ); $wp_customize->add_setting( 'content_layout_size', [ 'sanitize_callback' => 'absint', 'default' => $bansta_defaults['content_layout_size'], 'type' => 'theme_mod', 'capability' => 'edit_theme_options', ] ); $wp_customize->add_control( 'content_layout_size', [ 'settings' => 'content_layout_size', 'type' => 'number', 'section' => 'bansta_layout_section', 'label' => esc_html__('Content Size', 'bansta'), 'input_attrs' => [ 'min' => 1000, 'max' => 1600, 'step' => 10 ] ] );