add_section('bLab_topbar', array(
'title' => __('Header Topbar', 'beauty-lab'),
'panel' => 'beauty_lab_header',
'priority' => 1,
));
//-----header section-----
$wp_customize->add_section('bLab_header', array(
'title' => __('Header', 'beauty-lab'),
'panel' => 'beauty_lab_header',
'priority' => 2,
));
//----enable topbar-----
$wp_customize->add_setting( 'bLab_enable_header_topbar', array(
'default' => true,
'transport' => 'refresh',
'sanitize_callback' => 'themecon_sanitize_checkbox',
));
$wp_customize->add_control( 'bLab_enable_header_topbar_control',
array(
'label' => __( 'Enable Topbar', 'beauty-lab' ),
'section' => 'bLab_topbar',
'settings' => 'bLab_enable_header_topbar',
'type' => 'checkbox',
)
);
//---Topbar Background Color---
$wp_customize->add_setting('bLab_topbar_bg_color', array(
'default' => '#232428',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_hex_color',
));
$wp_customize->add_control('bLab_topbar_bg_color_control',
array(
'label' => __('Topbar Background Color', 'beauty-lab'),
'section' => 'bLab_topbar',
'settings' => 'bLab_topbar_bg_color',
'type' => 'color',
'active_callback' => 'bLab_enable_topbar_field',
)
);
//---Topbar Font Color---
$wp_customize->add_setting('bLab_topbar_font_color', array(
'default' => '#dddddd',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_hex_color',
));
$wp_customize->add_control('bLab_topbar_font_color_control',
array(
'label' => __('Topbar Font Color', 'beauty-lab'),
'section' => 'bLab_topbar',
'settings' => 'bLab_topbar_font_color',
'type' => 'color',
'active_callback' => 'bLab_enable_topbar_field',
)
);
//----Topbar Left Content-----
$wp_customize->add_setting( 'bLab_topbar_left', array(
'default' => ' Opening Hour: Mon - Fri : 09:00 - 18:00',
'transport' => 'refresh',
'sanitize_callback' => 'wp_kses_post',
));
$wp_customize->add_control( 'bLab_topbar_left_control',
array(
'label' => __( 'Topbar Left Content', 'beauty-lab' ),
'section' => 'bLab_topbar',
'settings' => 'bLab_topbar_left',
'type' => 'textarea',
'active_callback' => 'bLab_enable_topbar_field',
)
);
//----Topbar Right Content-----
$wp_customize->add_setting( 'bLab_topbar_right', array(
'default' => ' info@beautylab.com / 1800-111-333 ',
'transport' => 'refresh',
'sanitize_callback' => 'wp_kses_post',
));
$wp_customize->add_control( 'bLab_topbar_right_control',
array(
'label' => __( 'Topbar Right Content', 'beauty-lab' ),
'section' => 'bLab_topbar',
'settings' => 'bLab_topbar_right',
'type' => 'textarea',
'active_callback' => 'bLab_enable_topbar_field',
)
);
//--------------------------header options---------------------------//
//----enable seaerch icon-----
$wp_customize->add_setting( 'bLab_enable_header_search', array(
'default' => true,
'transport' => 'refresh',
'sanitize_callback' => 'themecon_sanitize_checkbox',
));
$wp_customize->add_control( 'bLab_enable_header_search_control',
array(
'label' => __( 'Enable Search Icon', 'beauty-lab' ),
'section' => 'bLab_header',
'settings' => 'bLab_enable_header_search',
'type' => 'checkbox',
)
);
//---Header Background Color---
$wp_customize->add_setting('bLab_header_bg_color', array(
'default' => '#ffffff',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_hex_color',
));
$wp_customize->add_control('bLab_header_bg_color_control',
array(
'label' => __('Background Color', 'beauty-lab'),
'section' => 'bLab_header',
'settings' => 'bLab_header_bg_color',
'type' => 'color',
)
);
//---header layout----
$wp_customize->add_setting('bLab_header_layout', array(
'default' => 'logoleft',
'transport' => 'refresh',
'sanitize_callback' => 'themecon_sanitize_select',
));
$wp_customize->add_control('bLab_header_layout_control',
array(
'label' => __('Header Layout', 'beauty-lab'),
'section' => 'bLab_header',
'settings' => 'bLab_header_layout',
'type' => 'select',
'choices' => array(
'logoleft' => __('Logo Left -- Menu Right', 'beauty-lab'),
'logoright' => __('Logo Right -- Menu Left', 'beauty-lab'),
),
)
);
//---Mobile menu breakpoint option----
$wp_customize->add_setting('bLab_mobile_breakpoint', array(
'default' => 991,
'transport' => 'refresh',
'sanitize_callback' => 'themecon_sanitize_select',
));
$wp_customize->add_control('bLab_mobile_breakpoint_control',
array(
'label' => __('Mobile Breakpoint', 'beauty-lab'),
'section' => 'bLab_header',
'settings' => 'bLab_mobile_breakpoint',
'type' => 'radio',
'choices' => array(
'1199' => __('From Viewport width 1199px','beauty-lab'),
'991' => __('From Viewport width 991px','beauty-lab'),
'767' => __('From Viewport width 767px','beauty-lab'),
'575' => __('From Viewport width 575px','beauty-lab'),
),
)
);
//---header typography separator---
$wp_customize->add_setting( 'bLab_header_typo_separator', array(
'sanitize_callback' => 'sanitize_text_field',
'default' => __('Menu Item Typography', 'beauty-lab'),
) );
$wp_customize->add_control(
new Beauty_Lab_Separator_Control( $wp_customize, 'bLab_header_typo_separator_control',
array(
'section' => 'bLab_header',
'settings' => 'bLab_header_typo_separator',
)
)
);
//---menu item font size----
$wp_customize->add_setting('bLab_menuitem_font_size', array(
'default' => 14,
'transport' => 'refresh',
'sanitize_callback' => 'themecon_intval',
));
$wp_customize->add_control('bLab_menuitem_font_size_control',
array(
'label' => __('Font Size (px)', 'beauty-lab'),
'section' => 'bLab_header',
'settings' => 'bLab_menuitem_font_size',
'type' => 'number',
)
);
//---menu item line height----
$wp_customize->add_setting('bLab_menuitem_line_height', array(
'default' => '1.6',
'transport' => 'refresh',
'sanitize_callback' => 'themecon_sanitize_float',
));
$wp_customize->add_control('bLab_menuitem_line_height_control',
array(
'label' => __('Line Height (em)', 'beauty-lab'),
'section' => 'bLab_header',
'settings' => 'bLab_menuitem_line_height',
'type' => 'number',
)
);
//---menu item font weight----
$wp_customize->add_setting('bLab_menuitem_font_weight', array(
'default' => '',
'transport' => 'refresh',
'sanitize_callback' => 'themecon_sanitize_select',
));
$wp_customize->add_control('bLab_menuitem_font_weight_control',
array(
'label' => __('Font Weight', 'beauty-lab'),
'section' => 'bLab_header',
'settings' => 'bLab_menuitem_font_weight',
'type' => 'select',
'choices' => themecon_customizer_font_weight(),//it from customizer-select-options.php
)
);
//---menu item transform----
$wp_customize->add_setting('bLab_menuitem_text_transform', array(
'default' => '',
'transport' => 'refresh',
'sanitize_callback' => 'themecon_sanitize_select',
));
$wp_customize->add_control('bLab_menuitem_text_transform_control',
array(
'label' => __('Text Transform', 'beauty-lab'),
'section' => 'bLab_header',
'settings' => 'bLab_menuitem_text_transform',
'type' => 'select',
'choices' => themecon_customizer_text_transform(),//it from customizer-select-options.php
)
);
//---menu item family----
$wp_customize->add_setting('bLab_menuitem_font_family', array(
'default' => '',
'transport' => 'refresh',
'sanitize_callback' => 'themecon_sanitize_select',
));
$wp_customize->add_control('bLab_menuitem_font_family_control',
array(
'label' => __('Font Family', 'beauty-lab'),
'section' => 'bLab_header',
'settings' => 'bLab_menuitem_font_family',
'type' => 'select',
'choices' => themecon_customizer_google_fonts(),//it from customizer-select-options.php
)
);
//---menu item color----
$wp_customize->add_setting('bLab_menuitem_color', array(
'default' => '#3b3b3b',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_hex_color',
));
$wp_customize->add_control('bLab_menuitem_color_control',
array(
'label' => __('Color', 'beauty-lab'),
'section' => 'bLab_header',
'settings' => 'bLab_menuitem_color',
'type' => 'color',
)
);
//---menu item hover color----
$wp_customize->add_setting('bLab_menuitem_hvr_color', array(
'default' => '#720f83',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_hex_color',
));
$wp_customize->add_control('bLab_menuitem_hvr_color_control',
array(
'label' => __('Hover Color', 'beauty-lab'),
'section' => 'bLab_header',
'settings' => 'bLab_menuitem_hvr_color',
'type' => 'color',
)
);
//---menu item active color----
$wp_customize->add_setting('bLab_menuitem_active_color', array(
'default' => '#d5275a',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_hex_color',
));
$wp_customize->add_control('bLab_menuitem_active_color_control',
array(
'label' => __('Active Color', 'beauty-lab'),
'section' => 'bLab_header',
'settings' => 'bLab_menuitem_active_color',
'type' => 'color',
)
);
//---header submenu separator---
$wp_customize->add_setting( 'bLab_header_submenu_separator', array(
'sanitize_callback' => 'sanitize_text_field',
'default' => __('Submenu Typography', 'beauty-lab'),
) );
$wp_customize->add_control(
new Beauty_Lab_Separator_Control( $wp_customize, 'bLab_header_submenu_separator_control',
array(
'section' => 'bLab_header',
'settings' => 'bLab_header_submenu_separator',
)
)
);
//---submenuitem item font size----
$wp_customize->add_setting('bLab_submenuitem_font_size', array(
'default' => 14,
'transport' => 'refresh',
'sanitize_callback' => 'themecon_intval',
));
$wp_customize->add_control('bLab_submenuitem_font_size_control',
array(
'label' => __('Font Size (px)', 'beauty-lab'),
'section' => 'bLab_header',
'settings' => 'bLab_submenuitem_font_size',
'type' => 'number',
)
);
//---submenuitem item line height----
$wp_customize->add_setting('bLab_submenuitem_line_height', array(
'default' => '1.6',
'transport' => 'refresh',
'sanitize_callback' => 'themecon_sanitize_float',
));
$wp_customize->add_control('bLab_submenuitem_line_height_control',
array(
'label' => __('Line Height (em)', 'beauty-lab'),
'section' => 'bLab_header',
'settings' => 'bLab_submenuitem_line_height',
'type' => 'number',
)
);
//---submenuitem item font weight----
$wp_customize->add_setting('bLab_submenuitem_font_weight', array(
'default' => '',
'transport' => 'refresh',
'sanitize_callback' => 'themecon_sanitize_select',
));
$wp_customize->add_control('bLab_submenuitem_font_weight_control',
array(
'label' => __('Font Weight', 'beauty-lab'),
'section' => 'bLab_header',
'settings' => 'bLab_submenuitem_font_weight',
'type' => 'select',
'choices' => themecon_customizer_font_weight(),//it from customizer-select-options.php
)
);
//---submenu item text transform----
$wp_customize->add_setting('bLab_submenuitem_text_transform', array(
'default' => '',
'transport' => 'refresh',
'sanitize_callback' => 'themecon_sanitize_select',
));
$wp_customize->add_control('bLab_submenuitem_text_transform_control',
array(
'label' => __('Text Transform', 'beauty-lab'),
'section' => 'bLab_header',
'settings' => 'bLab_submenuitem_text_transform',
'type' => 'select',
'choices' => themecon_customizer_text_transform(),//it from customizer-select-options.php
)
);
//---header mobile separator---
$wp_customize->add_setting( 'bLab_header_mobile_separator', array(
'sanitize_callback' => 'sanitize_text_field',
'default' => __('Mobile View Menu Style', 'beauty-lab'),
) );
$wp_customize->add_control(
new Beauty_Lab_Separator_Control( $wp_customize, 'bLab_header_mobile_separator_control',
array(
'section' => 'bLab_header',
'settings' => 'bLab_header_mobile_separator',
)
)
);
//---mobile view header layout----
$wp_customize->add_setting('bLab_header_mbl_layout', array(
'default' => 'hamburger-right',
'transport' => 'refresh',
'sanitize_callback' => 'themecon_sanitize_select',
));
$wp_customize->add_control('bLab_header_mbl_layout_control',
array(
'label' => __('Mobile Header Layout', 'beauty-lab'),
'section' => 'bLab_header',
'settings' => 'bLab_header_mbl_layout',
'type' => 'select',
'choices' => array(
'hamburger-right' => __('Logo Left -- Hamburger Right','beauty-lab'),
'hamburger-left' => __('Logo Right -- Hamburger Left','beauty-lab'),
),
)
);
//---mobile view menu item font size----
$wp_customize->add_setting('bLab_mbl_menuitem_font_size', array(
'default' => 14,
'transport' => 'refresh',
'sanitize_callback' => 'themecon_intval',
));
$wp_customize->add_control('bLab_mbl_menuitem_font_size_control',
array(
'label' => __('Main Menu Font Size (px)', 'beauty-lab'),
'section' => 'bLab_header',
'settings' => 'bLab_mbl_menuitem_font_size',
'type' => 'number',
)
);
//---mobile view menu item font size----
$wp_customize->add_setting('bLab_mbl_submenuitem_font_size', array(
'default' => 14,
'transport' => 'refresh',
'sanitize_callback' => 'themecon_intval',
));
$wp_customize->add_control('bLab_mbl_submenuitem_font_size_control',
array(
'label' => __('Submenu Font Size (px)', 'beauty-lab'),
'section' => 'bLab_header',
'settings' => 'bLab_mbl_submenuitem_font_size',
'type' => 'number',
)
);
}
add_action( 'customize_register', 'beauty_lab_customize_header' );
//---show topbar input field when enable topbar checkbox is checked--
function bLab_enable_topbar_field(){
if( get_theme_mod( 'bLab_enable_header_topbar' ) == 1 ){
return true;
}else{
return false;
}
}
?>