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_default['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', ])); //Primary color $wp_customize->add_setting( 'bansta_primary_color', [ 'default' => $bansta_default['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' => 'colors', 'inner-options' => [ ] ])); //Secondary color $wp_customize->add_setting( 'bansta_secondary_color', [ 'default' => $bansta_default['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' => 'colors', ])); //header background color $wp_customize->add_setting( 'bansta_header_background_color', [ 'default' => $bansta_default['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, 'bansta_header_background_color', [ 'label' => __('Header color', 'bansta'), 'settings' => 'bansta_header_background_color', 'section' => 'colors', ])); //Top nav background color $wp_customize->add_setting( 'bansta_topnav_background_color', [ 'default' => $bansta_default['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, 'bansta_topnav_background_color', [ 'label' => __('Top nav color', 'bansta'), 'settings' => 'bansta_topnav_background_color', 'section' => 'colors', ])); //Main nav background color $wp_customize->add_setting( 'bansta_mainnav_background_color', [ 'default' => $bansta_default['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, 'bansta_mainnav_background_color', [ 'label' => __('Main nav color', 'bansta'), 'settings' => 'bansta_mainnav_background_color', 'section' => 'colors', '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_default['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' => 'colors', ])); //Link:hover color $wp_customize->add_setting( 'bansta_link_hover_color', [ 'default' => $bansta_default['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' => 'colors', ])); //Content color $wp_customize->add_setting( 'bansta_content_color', [ 'default' => $bansta_default['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' => 'colors', ])); //Layout Section $wp_customize->add_section( 'bansta_layout_section', [ 'title' => esc_html__('Container Size', 'bansta'), 'panel' => 'bansta_layout_panel', 'priority' => 21 ] ); $wp_customize->add_setting( 'bansta_container_layout_size', [ 'sanitize_callback' => 'bansta_sanitize_select', 'default' => $bansta_default['container_layout_size'], 'type' => 'theme_mod', 'capability' => 'edit_theme_options', ] ); $wp_customize->add_control( 'bansta_container_layout_size', [ 'label' => esc_html__('Container Size', 'bansta'), 'settings' => 'bansta_container_layout_size', 'type' => 'select', 'section' => 'bansta_layout_section', 'choices' => [ 'boxed' => __( 'Boxed', 'bansta' ), 'stretched' => __( 'Stretched', 'bansta' ) ] ] ); $wp_customize->add_setting( 'bansta_header_layout_size', [ 'sanitize_callback' => 'absint', 'default' => $bansta_default['container_layout_size'], 'type' => 'theme_mod', 'capability' => 'edit_theme_options', ] ); $wp_customize->add_control( 'bansta_header_layout_size', [ 'settings' => 'bansta_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( 'bansta_grid_layout_size', [ 'sanitize_callback' => 'absint', 'default' => $bansta_default['grid_layout_size'], 'type' => 'theme_mod', 'capability' => 'edit_theme_options', ] ); $wp_customize->add_control( 'bansta_grid_layout_size', [ 'settings' => 'bansta_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( 'bansta_content_layout_size', [ 'sanitize_callback' => 'absint', 'default' => $bansta_default['content_layout_size'], 'type' => 'theme_mod', 'capability' => 'edit_theme_options', ] ); $wp_customize->add_control( 'bansta_content_layout_size', [ 'settings' => 'bansta_content_layout_size', 'type' => 'number', 'section' => 'bansta_layout_section', 'label' => esc_html__('Content Size', 'bansta'), 'input_attrs' => [ 'min' => 1000, 'max' => 1600, 'step' => 10 ] ] );