get_setting( 'wheeloflife_color' )->default = '#fff8f5'; } } add_action( 'customize_register', 'seva_business_overide_values', 999 ); /** * Customizer Settings */ function seva_business_customizer_register( $wp_customize ){ $wp_customize->add_section( 'theme_info', array( 'title' => __( 'Demo & Documentation' , 'seva-business' ), 'priority' => 6, ) ); /** Important Links */ $wp_customize->add_setting( 'theme_info_theme', array( 'default' => '', 'sanitize_callback' => 'wp_kses_post', ) ); $theme_info = '
'; $theme_info .= sprintf( __( 'Demo Link: %1$sClick here.%2$s', 'seva-business' ), '', '' ); $theme_info .= '
'; $theme_info .= sprintf( __( 'Documentation Link: %1$sClick here.%2$s', 'seva-business' ), '', '' ); $theme_info .= '
'; $wp_customize->add_control( new Seva_Lite_Note_Control( $wp_customize, 'theme_info_theme', array( 'section' => 'theme_info', 'description' => $theme_info ) ) ); /** Appearance Settings */ $wp_customize->add_panel( 'appearance_settings', array( 'title' => __( 'Appearance Settings', 'seva-business' ), 'priority' => 25, 'capability' => 'edit_theme_options', 'description' => __( 'Change color and body background.', 'seva-business' ), ) ); /** Typography */ $wp_customize->add_section( 'typography_settings', array( 'title' => __( 'Typography', 'seva-business' ), 'priority' => 20, 'panel' => 'appearance_settings', ) ); /** Primary Font */ $wp_customize->add_setting( 'primary_font', array( 'default' => 'Nunito Sans', 'sanitize_callback' => 'seva_lite_sanitize_select' ) ); $wp_customize->add_control( new Seva_Lite_Select_Control( $wp_customize, 'primary_font', array( 'label' => __( 'Primary Font', 'seva-business' ), 'description' => __( 'Primary font of the site.', 'seva-business' ), 'section' => 'typography_settings', 'choices' => seva_lite_get_all_fonts(), ) ) ); /** Secondary Font */ $wp_customize->add_setting( 'secondary_font', array( 'default' => 'Roboto Slab', 'sanitize_callback' => 'seva_lite_sanitize_select' ) ); $wp_customize->add_control( new Seva_Lite_Select_Control( $wp_customize, 'secondary_font', array( 'label' => __( 'Secondary Font', 'seva-business' ), 'description' => __( 'Secondary font of the site.', 'seva-business' ), 'section' => 'typography_settings', 'choices' => seva_lite_get_all_fonts(), ) ) ); /** Font Size*/ $wp_customize->add_setting( 'font_size', array( 'default' => 18, 'sanitize_callback' => 'seva_lite_sanitize_number_absint' ) ); $wp_customize->add_control( new Seva_Lite_Slider_Control( $wp_customize, 'font_size', array( 'section' => 'typography_settings', 'label' => __( 'Font Size', 'seva-business' ), 'description' => __( 'Change the font size of your site.', 'seva-business' ), 'choices' => array( 'min' => 10, 'max' => 50, 'step' => 1, ) ) ) ); /** Move Background Image section to appearance panel */ $wp_customize->get_section( 'colors' )->panel = 'appearance_settings'; $wp_customize->get_section( 'colors' )->priority = 10; $wp_customize->get_section( 'background_image' )->panel = 'appearance_settings'; $wp_customize->get_section( 'background_image' )->priority = 15; $wp_customize->get_setting( 'background_color' )->default = '#ffffff'; /** Adding panel for layouts */ $wp_customize->add_panel( 'layout_settings', array( 'priority' => 35, 'capability' => 'edit_theme_options', 'title' => __( 'Layout Settings', 'seva-business' ), 'description' => __( 'Customize Typography, Header Image & Background Image', 'seva-business' ), ) ); /** Move general layout section to Layout panel */ $wp_customize->get_section( 'general_layout_settings' )->panel = 'layout_settings'; $wp_customize->get_section( 'general_layout_settings' )->title = __( 'General Layout Settings', 'seva-business' ); /** Header Layout Settings */ $wp_customize->add_section( 'header_layout_section', array( 'priority' => 5, 'title' => __( 'Header Layout', 'seva-business' ), 'panel' => 'layout_settings', ) ); $wp_customize->add_setting( 'header_layout', array( 'default' => 'three', 'sanitize_callback' => 'seva_lite_sanitize_radio' ) ); $wp_customize->add_control( new Seva_Lite_Radio_Image_Control( $wp_customize, 'header_layout', array( 'section' => 'header_layout_section', 'label' => __( 'Header Layout', 'seva-business' ), 'description' => __( 'Choose the layout of the header for your site.', 'seva-business' ), 'choices' => array( 'one' => get_stylesheet_directory_uri() . '/images/header/one.jpg', 'three' => get_stylesheet_directory_uri() . '/images/header/three.jpg', ) ) ) ); /** CTA Banner Layout Settings */ $wp_customize->add_section( 'banner_layout_section', array( 'priority' => 10, 'title' => __( 'CTA Banner Layout', 'seva-business' ), 'panel' => 'layout_settings', ) ); $wp_customize->add_setting( 'banner_layout', array( 'default' => 'one', 'sanitize_callback' => 'seva_lite_sanitize_radio' ) ); $wp_customize->add_control( new Seva_Lite_Radio_Image_Control( $wp_customize, 'banner_layout', array( 'section' => 'banner_layout_section', 'label' => __( 'CTA Banner Layout', 'seva-business' ), 'description' => __( 'Choose the layout for the slider for your site.', 'seva-business' ), 'choices' => array( 'six' => get_stylesheet_directory_uri() . '/images/static_banner/cta_six.jpg', 'one' => get_stylesheet_directory_uri() . '/images/static_banner/cta_one.jpg', ) ) ) ); $wp_customize->add_setting( 'cta_static_banner_layout_text', array( 'default' => '', 'sanitize_callback' => 'wp_kses_post' ) ); $wp_customize->add_control( new Seva_Lite_Note_Control( $wp_customize, 'cta_static_banner_layout_text', array( 'section' => 'banner_layout_section', 'description' => sprintf( __( '%1$sClick here%2$s to configure static banner settings.', 'seva-business' ), ' ' ), ) ) ); $wp_customize->add_setting( 'cta_banner_secondary_image', array( 'default' => '', 'sanitize_callback' => 'seva_lite_sanitize_image', ) ); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'cta_banner_secondary_image', array( 'label' => esc_html__( 'Secondary Image', 'seva-business' ), 'description' => esc_html__( 'Choose the secondary image for cta banner section.', 'seva-business' ), 'section' => 'header_image', 'type' => 'image', 'active_callback' => 'seva_business_ac', ) ) ); $wp_customize->add_setting( 'cta_static_banner_text', array( 'default' => '', 'sanitize_callback' => 'wp_kses_post' ) ); $wp_customize->add_control( new Seva_Lite_Note_Control( $wp_customize, 'cta_static_banner_text', array( 'section' => 'header_image', 'description' => sprintf( __( '%1$sClick here%2$s to select the layout of static banner.', 'seva-business' ), ' ' ), 'active_callback' => 'seva_business_ac' ) ) ); /** Enable Header Search */ $wp_customize->add_setting( 'ed_header_search', array( 'default' => true, 'sanitize_callback' => 'seva_lite_sanitize_checkbox' ) ); $wp_customize->add_control( new Seva_Lite_Toggle_Control( $wp_customize, 'ed_header_search', array( 'section' => 'header_settings', 'label' => __( 'Enable Header Search', 'seva-business' ), 'description' => __( 'Enable to show Search button in header.', 'seva-business' ), 'active_callback' => 'seva_business_ac' ) ) ); /** Shopping Cart */ $wp_customize->add_setting( 'ed_shopping_cart', array( 'default' => true, 'sanitize_callback' => 'seva_lite_sanitize_checkbox' ) ); $wp_customize->add_control( new Seva_Lite_Toggle_Control( $wp_customize, 'ed_shopping_cart', array( 'section' => 'header_settings', 'label' => __( 'Shopping Cart', 'seva-business' ), 'description' => __( 'Enable to show Shopping cart in the header.', 'seva-business' ), 'active_callback' => 'seva_lite_is_woocommerce_activated' ) ) ); $wp_customize->add_setting( 'header_layout_text', array( 'default' => '', 'sanitize_callback' => 'wp_kses_post' ) ); $wp_customize->add_control( new Seva_Lite_Note_Control( $wp_customize, 'header_layout_text', array( 'section' => 'header_layout_section', 'description' => sprintf( __( '%1$sClick here%2$s to change header settings.', 'seva-business' ), '', '' ), ) ) ); $wp_customize->add_setting( 'header_setting_text', array( 'default' => '', 'sanitize_callback' => 'wp_kses_post' ) ); $wp_customize->add_control( new Seva_Lite_Note_Control( $wp_customize, 'header_setting_text', array( 'section' => 'header_settings', 'description' => sprintf( __( '%1$sClick here%2$s to change header layout.', 'seva-business' ), '', '' ), ) ) ); } add_action( 'customize_register', 'seva_business_customizer_register', 40 ); function seva_business_ac( $control ){ $banner = $control->manager->get_setting( 'ed_banner_section' )->value(); $cta_layout = $control->manager->get_setting( 'banner_layout' )->value(); $header_layout = $control->manager->get_setting( 'header_layout' )->value(); $control_id = $control->id; if ( $control_id == 'cta_banner_secondary_image' && $banner == 'static_banner' && ( $cta_layout == 'one' ) ) return true; if( $control_id == 'ed_header_search' && $header_layout != 'one' ) return true; if ( $control_id == 'cta_static_banner_text' && $banner == 'static_banner' ) return true; return false; } /** * Form */ function seva_business_header_search(){ ?>