add_section('custom_header_section', array( 'title' => __('Custom Header', 'arcs'), 'priority' => 30, )); // Background Color $wp_customize->add_setting('header_background_color', array( 'default' => '#ffffff', 'sanitize_callback' => 'sanitize_hex_color', )); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'header_background_color', array( 'label' => __('Background Color', 'arcs'), 'section' => 'custom_header_section', 'settings' => 'header_background_color', ))); // Background Image $wp_customize->add_setting('header_background_image', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw', )); $wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'header_background_image', array( 'label' => __('Background Image', 'arcs'), 'section' => 'custom_header_section', 'settings' => 'header_background_image', ))); // Background Image Properties $wp_customize->add_setting('header_background_properties', array( 'default' => 'cover', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('header_background_properties', array( 'label' => __('Background Image Properties', 'arcs'), 'section' => 'custom_header_section', 'settings' => 'header_background_properties', 'type' => 'select', 'choices' => array( 'cover' => __('Cover', 'arcs'), 'contain' => __('Contain', 'arcs'), 'auto' => __('Auto', 'arcs'), 'initial' => __('Initial', 'arcs'), ), )); // Background Position $wp_customize->add_setting('header_background_position', array( 'default' => 'center center', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('header_background_position', array( 'label' => __('Background Position', 'arcs'), 'section' => 'custom_header_section', 'settings' => 'header_background_position', 'type' => 'text', )); // Background Attachment $wp_customize->add_setting('header_background_attachment', array( 'default' => 'scroll', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('header_background_attachment', array( 'label' => __('Background Attachment', 'arcs'), 'section' => 'custom_header_section', 'settings' => 'header_background_attachment', 'type' => 'select', 'choices' => array( 'scroll' => __('Scroll', 'arcs'), 'fixed' => __('Fixed', 'arcs'), ), )); // Background Repeat $wp_customize->add_setting('header_background_repeat', array( 'default' => 'no-repeat', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('header_background_repeat', array( 'label' => __('Background Repeat', 'arcs'), 'section' => 'custom_header_section', 'settings' => 'header_background_repeat', 'type' => 'select', 'choices' => array( 'no-repeat' => __('No Repeat', 'arcs'), 'repeat' => __('Repeat', 'arcs'), 'repeat-x' => __('Repeat-X', 'arcs'), 'repeat-y' => __('Repeat-Y', 'arcs'), ), )); } add_action('customize_register', 'custom_header_customizer_settings'); //menu-section // Register Customizer Settings and Controls for Header Menu function custom_header_menu_customizer_settings($wp_customize) { // Header Menu Section $wp_customize->add_section('header_menu_section', array( 'title' => __('Header Menu', 'arcs'), 'priority' => 31, )); // Font Size $wp_customize->add_setting('header_menu_font_size', array( 'default' => '16px', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('header_menu_font_size', array( 'label' => __('Font Size', 'arcs'), 'section' => 'header_menu_section', 'type' => 'text', )); // Font Weight $wp_customize->add_setting('header_menu_font_weight', array( 'default' => 'normal', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('header_menu_font_weight', array( 'label' => __('Font Weight', 'arcs'), 'section' => 'header_menu_section', 'type' => 'select', 'choices' => array( 'light' => __('Light', 'arcs'), 'normal' => __('Regular', 'arcs'), 'bold' => __('Bold', 'arcs'), ), )); // Font Style $wp_customize->add_setting('header_menu_font_style', array( 'default' => 'normal', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('header_menu_font_style', array( 'label' => __('Font Style', 'arcs'), 'section' => 'header_menu_section', 'type' => 'select', 'choices' => array( 'normal' => __('Normal', 'arcs'), 'italic' => __('Italic', 'arcs'), 'oblique' => __('Oblique', 'arcs'), 'unset' => __('Unset', 'arcs'), 'revert' => __('Revert', 'arcs'), 'revert-layer' => __('Revert-layer', 'arcs'), 'initial' => __('Initial', 'arcs'), 'inherit' => __('Inherit', 'arcs'), ), )); // Line Height $wp_customize->add_setting('header_menu_line_height', array( 'default' => '1.5', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('header_menu_line_height', array( 'label' => __('Line Height', 'arcs'), 'section' => 'header_menu_section', 'type' => 'text', )); // Font Color $wp_customize->add_setting('header_menu_font_color', array( 'default' => '#000000', 'sanitize_callback' => 'sanitize_hex_color', )); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'header_menu_font_color', array( 'label' => __('Font Color', 'arcs'), 'section' => 'header_menu_section', 'settings' => 'header_menu_font_color', ))); // Border Width $wp_customize->add_setting('header_menu_border_width', array( 'default' => '1px', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('header_menu_border_width', array( 'label' => __('Border Width', 'arcs'), 'section' => 'header_menu_section', 'type' => 'text', )); // Border Style $wp_customize->add_setting('header_menu_border_style', array( 'default' => 'solid', 'sanitize_callback' => 'sanitize_text_field', )); $wp_customize->add_control('header_menu_border_style', array( 'label' => __('Border Style', 'arcs'), 'section' => 'header_menu_section', 'type' => 'select', 'choices' => array( 'none' => __('None', 'arcs'), 'solid' => __('Solid', 'arcs'), 'dotted' => __('Dotted', 'arcs'), // Add more border styles as needed ), )); // Border Color $wp_customize->add_setting('header_menu_border_color', array( 'default' => '#000000', 'sanitize_callback' => 'sanitize_hex_color', )); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'header_menu_border_color', array( 'label' => __('Border Color', 'arcs'), 'section' => 'header_menu_section', 'settings' => 'header_menu_border_color', ))); } add_action('customize_register', 'custom_header_menu_customizer_settings'); // Burger Area Section function arcs_customizer_burger_section( $wp_customize ) { // Add section for burger customization $wp_customize->add_section( 'burger_customization_section', array( 'title' => __( 'Burger Customization', 'arcs' ), 'priority' => 30, ) ); // Add control for background color $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'burger_background_color', array( 'label' => __( 'Background Color', 'arcs' ), 'section' => 'burger_customization_section', 'settings' => 'burger_background_color', ) ) ); // Add setting for color $wp_customize->add_setting( 'burger_color', array( 'default' => '#000000', 'sanitize_callback' => 'sanitize_hex_color', ) ); // Add control for color $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'burger_color', array( 'label' => __( 'Color', 'arcs' ), 'section' => 'burger_customization_section', 'settings' => 'burger_color', ) ) ); // Add setting for font size $wp_customize->add_setting( 'burger_font_size', array( 'default' => '16px', 'sanitize_callback' => 'sanitize_text_field', ) ); // Add control for font size $wp_customize->add_control( 'burger_font_size', array( 'type' => 'text', 'label' => __( 'Font Size', 'arcs' ), 'section' => 'burger_customization_section', 'input_attrs' => array( 'style' => 'width: 100px;', // Adjust the width as needed ), ) ); } add_action( 'customize_register', 'arcs_customizer_burger_section' ); function arcs_dynamic_styles() { // Retrieve and escape the theme mod values $header_background_image = esc_url(get_theme_mod('header_background_image', '')); $header_background_color = esc_attr(get_theme_mod('header_background_color', '#ffffff')); $header_background_properties = esc_attr(get_theme_mod('header_background_properties', 'cover')); $header_background_position = esc_attr(get_theme_mod('header_background_position', 'center center')); $header_background_attachment = esc_attr(get_theme_mod('header_background_attachment', 'scroll')); $header_background_repeat = esc_attr(get_theme_mod('header_background_repeat', 'no-repeat')); $header_menu_border_width = esc_attr(get_theme_mod('header_menu_border_width', '1px')); $header_menu_border_style = esc_attr(get_theme_mod('header_menu_border_style', 'solid')); $header_menu_border_color = esc_attr(get_theme_mod('header_menu_border_color', '#000000')); $header_menu_font_size = esc_attr(get_theme_mod('header_menu_font_size', '16px')); $header_menu_font_weight = esc_attr(get_theme_mod('header_menu_font_weight', 'normal')); $header_menu_font_style = esc_attr(get_theme_mod('header_menu_font_style', 'normal')); $header_menu_line_height = esc_attr(get_theme_mod('header_menu_line_height', '1.5')); $header_menu_font_color = esc_attr(get_theme_mod('header_menu_font_color', '#000000')); $burger_color = esc_attr(get_theme_mod('burger_color', '#000000')); $burger_font_size = esc_attr(get_theme_mod('burger_font_size', '16px')); ?> add_section('submenu_colors_section', array( 'title' => __('Submenu Colors', 'arcs'), 'priority' => 30, )); // Add setting and control for submenu background color $wp_customize->add_setting('submenu_bg_color', array( 'default' => '#ffffff', // Default background color 'sanitize_callback' => 'sanitize_hex_color', // Sanitization callback )); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'submenu_bg_color_control', array( 'label' => __('Submenu Background Color', 'arcs'), 'section' => 'submenu_colors_section', 'settings' => 'submenu_bg_color', ))); // Add setting and control for submenu background hover color $wp_customize->add_setting('submenu_bg_hover_color', array( 'default' => '#e6e6e6', // Default background hover color 'sanitize_callback' => 'sanitize_hex_color', // Sanitization callback )); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'submenu_bg_hover_color_control', array( 'label' => __('Submenu Background Hover Color', 'arcs'), 'section' => 'submenu_colors_section', 'settings' => 'submenu_bg_hover_color', ))); // Add setting and control for submenu text color $wp_customize->add_setting('submenu_text_color', array( 'default' => '#333333', // Default text color 'sanitize_callback' => 'sanitize_hex_color', // Sanitization callback )); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'submenu_text_color_control', array( 'label' => __('Submenu Text Color', 'arcs'), 'section' => 'submenu_colors_section', 'settings' => 'submenu_text_color', ))); // Add setting and control for submenu text hover color $wp_customize->add_setting('submenu_text_hover_color', array( 'default' => '#000000', // Default text hover color 'sanitize_callback' => 'sanitize_hex_color', // Sanitization callback )); $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'submenu_text_hover_color_control', array( 'label' => __('Submenu Text Hover Color', 'arcs'), 'section' => 'submenu_colors_section', 'settings' => 'submenu_text_hover_color', ))); } add_action('customize_register', 'customize_submenu_colors'); // Output submenu colors CSS function output_submenu_colors_css() { $submenu_bg_color = get_theme_mod('submenu_bg_color', '#ffffff'); $submenu_bg_hover_color = get_theme_mod('submenu_bg_hover_color', '#e6e6e6'); $submenu_text_color = get_theme_mod('submenu_text_color', '#333333'); $submenu_text_hover_color = get_theme_mod('submenu_text_hover_color', '#000000'); // Output CSS echo ''; } add_action('wp_head', 'output_submenu_colors_css');