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(){ ?> cart->cart_contents_count; if( $cart_page ){ ?>
'; seva_lite_social_links(); echo '
'; } ?> '; seva_business_wc_cart_count(); echo '
'; } ?>
'Nunito Sans', 'variant'=>'regular' ) ); $ig_site_title_font = seva_lite_is_google_font( $site_title_font['font-family'] ); /* Translators: If there are characters in your language that are not * supported by respective fonts, translate this to 'off'. Do not translate * into your own language. */ $primary = _x( 'on', 'Primary Font: on or off', 'seva-business' ); $secondary = _x( 'on', 'Secondary Font: on or off', 'seva-business' ); $site_title = _x( 'on', 'Site Title Font: on or off', 'seva-business' ); if ( 'off' !== $primary || 'off' !== $secondary || 'off' !== $site_title ) { $font_families = array(); if ( 'off' !== $primary && $ig_primary_font ) { $primary_variant = seva_lite_check_varient( $primary_font, 'regular', true ); if( $primary_variant ){ $primary_var = ':' . $primary_variant; }else{ $primary_var = ''; } $font_families[] = $primary_font . $primary_var; } if ( 'off' !== $secondary && $ig_secondary_font ) { $secondary_variant = seva_lite_check_varient( $secondary_font, 'regular', true ); if( $secondary_variant ){ $secondary_var = ':' . $secondary_variant; }else{ $secondary_var = ''; } $font_families[] = $secondary_font . $secondary_var; } if ( 'off' !== $site_title && $ig_site_title_font ) { if( ! empty( $site_title_font['variant'] ) ){ $site_title_var = ':' . seva_lite_check_varient( $site_title_font['font-family'], $site_title_font['variant'] ); }else{ $site_title_var = ''; } $font_families[] = $site_title_font['font-family'] . $site_title_var; } $font_families = array_diff( array_unique( $font_families ), array('') ); $query_args = array( 'family' => urlencode( implode( '|', $font_families ) ), ); $fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' ); } return esc_url( $fonts_url ); } /* Dynamic CSS */ function seva_business_dynamic_css(){ $primary_font = get_theme_mod( 'primary_font', 'Nunito Sans' ); $primary_fonts = seva_lite_get_fonts( $primary_font, 'regular' ); $secondary_font = get_theme_mod( 'secondary_font', 'Roboto Slab' ); $secondary_fonts = seva_lite_get_fonts( $secondary_font, 'regular' ); $font_size = get_theme_mod( 'font_size', 18 ); $site_title_font = get_theme_mod( 'site_title_font', array( 'font-family'=>'Nunito Sans', 'variant'=>'regular' ) ); $site_title_fonts = seva_lite_get_fonts( $site_title_font['font-family'], $site_title_font['variant'] ); $site_title_font_size = get_theme_mod( 'site_title_font_size', 30 ); $primary_color = '#03a6a6'; $secondary_color = '#de8d7b'; $logo_width = get_theme_mod( 'logo_width', 150 ); $background_color = get_theme_mod( 'background_color', '#ffffff' ); $tc_font_size = get_theme_mod( 'testimonial_content_font_size', 20 ); $rgb = seva_lite_hex2rgb( seva_lite_sanitize_hex_color( $primary_color ) ); $rgb2 = seva_lite_hex2rgb( seva_lite_sanitize_hex_color( $secondary_color ) ); $rgb4 = seva_lite_hex2rgb( seva_lite_sanitize_hex_color( $background_color ) ); $about_bg = get_theme_mod( 'about_bg_image', get_template_directory_uri() . '/images/about-bg-img.png' ); $contact_bg = get_theme_mod( 'contact_bg_image' ); $wheeloflife_color = get_theme_mod( 'wheeloflife_color', '#fff8f5' ); echo ""; } add_action( 'wp_head', 'seva_business_dynamic_css', 99 );