manager->get_setting( 'ed_banner_section' )->value(); $slider_type = $control->manager->get_setting( 'slider_type' )->value(); $control_id = $control->id; if ( $control_id == 'header_image' && ( $banner == 'static_nl_banner' || $banner =='static_banner' ) ) return true; if ( $control_id == 'header_video' && ( $banner == 'static_nl_banner' || $banner =='static_banner' ) ) return true; if ( $control_id == 'external_header_video' && ( $banner == 'static_nl_banner' || $banner =='static_banner' ) ) return true; if ( $control_id == 'banner_newsletter' && $banner == 'static_nl_banner' ) return true; if ( $control_id == 'slider_type' && $banner == 'slider_banner' ) return true; if ( $control_id == 'slider_auto' && $banner == 'slider_banner' ) return true; if ( $control_id == 'slider_loop' && $banner == 'slider_banner' ) return true; if ( $control_id == 'slider_caption' && $banner == 'slider_banner' ) return true; if ( $control_id == 'slider_readmore' && $banner == 'slider_banner' ) return true; if ( $control_id == 'slider_cat' && $banner == 'slider_banner' && $slider_type == 'cat' ) return true; if ( $control_id == 'no_of_slides' && $banner == 'slider_banner' && $slider_type == 'latest_posts' ) return true; if ( $control_id == 'slider_animation' && $banner == 'slider_banner' ) return true; if ( $control_id == 'hr' && $banner == 'slider_banner' ) return true; if ( $control_id == 'banner_title' && $banner == 'static_banner' ) return true; if ( $control_id == 'banner_subtitle' && $banner == 'static_banner' ) return true; if ( $control_id == 'banner_description' && $banner == 'static_banner' ) return true; if ( $control_id == 'banner_label' && $banner == 'static_banner' ) return true; if ( $control_id == 'banner_link' && $banner == 'static_banner' ) return true; if ( $control_id == 'ed_banner_open_new_target' && $banner == 'static_banner' ) return true; if ( $control_id == 'banner_image_alignment' && ( $banner == 'static_nl_banner' || $banner == 'static_banner' ) ) return true; if ( $control_id == 'banner_caption_layout' && $banner == 'static_banner' ) return true; return false; } /** * Active Callback for header */ function business_coach_inquiry_button_ac( $control ){ $header = $control->manager->get_setting( 'header_layout' )->value(); $control_id = $control->id; if ( $control_id == 'header_inquire_button' && $header == 'twelve' ) return true; if ( $control_id == 'header_inquire_url' && $header == 'twelve' ) return true; return false; } /** * Header Inquire Button */ function business_coach_get_header_inquire_button(){ return esc_html( get_theme_mod( 'header_inquire_button', __( 'Contact', 'business-coach' ) ) ); } function business_coach_customizer_register( $wp_customize ) { require_once get_stylesheet_directory() . '/inc/partials.php'; require_once get_stylesheet_directory() . '/inc/custom-controls/radiobtn/class-radio-buttonset-control.php'; // Register the control type. $wp_customize->register_control_type( 'Business_Coach_Radio_Buttonset_Control' ); /** rearrangement sections of Home panel */ $wp_customize->get_section( 'about' )->priority = 30; $wp_customize->get_section( 'blog_section' )->priority = 80; $wp_customize->add_section( 'theme_info', array( 'title' => __( 'Information Links', 'business-coach' ), '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', 'business-coach' ), '', '' ); $theme_info .= '

'; $theme_info .= sprintf( __( 'Documentation Link: %1$sClick here.%2$s', 'business-coach' ), '', '' ); $theme_info .= '

'; $wp_customize->add_control( new Vandana_Lite_Note_Control( $wp_customize, 'theme_info_theme', array( 'section' => 'theme_info', 'description' => $theme_info ) ) ); /** Header Layout Settings */ $wp_customize->add_section( 'header_layout_settings', array( 'title' => __( 'Header Layout', 'business-coach' ), 'priority' => 10, 'panel' => 'layout_settings', ) ); $wp_customize->add_setting( 'header_layout', array( 'default' => 'twelve', 'sanitize_callback' => 'vandana_lite_sanitize_radio' ) ); $wp_customize->add_control( new Vandana_Lite_Radio_Image_Control( $wp_customize, 'header_layout', array( 'section' => 'header_layout_settings', 'label' => __( 'Header Layout', 'business-coach' ), 'description' => __( 'Choose the layout of the header for your site.', 'business-coach' ), 'choices' => array( 'one' => get_stylesheet_directory_uri() . '/images/header-one.jpg', 'twelve' => get_stylesheet_directory_uri() . '/images/header-twelve.png', ) ) ) ); /** Header Phone */ $wp_customize->add_setting( 'phone', array( 'default' => __( '+123-456-7890', 'business-coach' ), 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage' ) ); $wp_customize->add_control( 'phone', array( 'type' => 'text', 'section' => 'header_settings', 'label' => __( 'Phone', 'business-coach' ), ) ); $wp_customize->selective_refresh->add_partial('phone', array( 'selector' => '.site-header .header-block:first-child a', 'render_callback' => 'business_coach_get_header_phone', )); /** Header Email */ $wp_customize->add_setting( 'email', array( 'default' => __( 'mail@domain.com', 'business-coach' ), 'sanitize_callback' => 'sanitize_email', 'transport' => 'postMessage' ) ); $wp_customize->add_control( 'email', array( 'type' => 'text', 'section' => 'header_settings', 'label' => __( 'Email', 'business-coach' ), ) ); $wp_customize->selective_refresh->add_partial('email', array( 'selector' => '.site-header .header-block:last-child a', 'render_callback' => 'business_coach_get_header_email', )); $wp_customize->add_setting( 'header_inquire_button', array( 'default' => __( 'Contact', 'business-coach' ), 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage' ) ); $wp_customize->add_control( 'header_inquire_button', array( 'label' => __( 'Header Inquire Button', 'business-coach' ), 'description' => __( 'This button shows only on header layouts 9, 11 & 12', 'business-coach' ), 'section' => 'header_settings', 'type' => 'text', 'active_callback' => 'business_coach_inquiry_button_ac', ) ); $wp_customize->selective_refresh->add_partial('header_inquire_button', array( 'selector' => '.site-header .button-wrap .btn-readmore', 'render_callback' => 'business_coach_get_header_inquire_button', )); $wp_customize->add_setting( 'header_inquire_url', array( 'default' => '#', 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( 'header_inquire_url', array( 'label' => __( 'Header Inquiry Link', 'business-coach' ), 'section' => 'header_settings', 'type' => 'url', 'active_callback' => 'business_coach_inquiry_button_ac', ) ); /** Banner Options */ $wp_customize->add_setting( 'ed_banner_section', array( 'default' => 'static_nl_banner', 'sanitize_callback' => 'vandana_lite_sanitize_select' ) ); $wp_customize->add_control( new Vandana_Lite_Select_Control( $wp_customize, 'ed_banner_section', array( 'label' => __( 'Banner Options', 'business-coach' ), 'description' => __( 'Choose banner as static image/video or as a slider.', 'business-coach' ), 'section' => 'header_image', 'choices' => array( 'no_banner' => __( 'Disable Banner Section', 'business-coach' ), 'static_banner' => __( 'Static/Video CTA Banner', 'business-coach' ), 'static_nl_banner' => __( 'Static/Video Newsletter Banner', 'business-coach' ), 'slider_banner' => __( 'Banner as Slider', 'business-coach' ), ), 'priority' => 5 ) ) ); /** Subitle */ $wp_customize->add_setting( 'banner_subtitle', array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage' ) ); $wp_customize->add_control( 'banner_subtitle', array( 'label' => __( 'Subtitle', 'business-coach' ), 'section' => 'header_image', 'type' => 'text', 'active_callback' => 'vandana_lite_banner_ac' ) ); $wp_customize->selective_refresh->add_partial( 'banner_subtitle', array( 'selector' => '.site-banner .banner-caption .subtitle', 'render_callback' => 'business_coach_get_banner_subtitle', ) ); /** Title */ $wp_customize->add_setting( 'banner_title', array( 'default' => __( 'No Matter How Good You Are At Anything A Leader Makes You Better', 'business-coach' ), 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage' ) ); $wp_customize->add_control( 'banner_title', array( 'label' => __( 'Title', 'business-coach' ), 'section' => 'header_image', 'type' => 'text', 'active_callback' => 'vandana_lite_banner_ac' ) ); $wp_customize->selective_refresh->add_partial( 'banner_title', array( 'selector' => '.site-banner .banner-caption h2.title', 'render_callback' => 'business_coach_get_banner_title', ) ); /** Description */ $wp_customize->add_setting( 'banner_description', array( 'default' => '', 'sanitize_callback' => 'sanitize_textarea_field', 'transport' => 'postMessage' ) ); $wp_customize->add_control( 'banner_description', array( 'label' => __( 'Description', 'business-coach' ), 'section' => 'header_image', 'type' => 'textarea', 'active_callback' => 'vandana_lite_banner_ac' ) ); $wp_customize->selective_refresh->add_partial( 'banner_description', array( 'selector' => '.site-banner .banner-caption .description', 'render_callback' => 'business_coach_get_banner_description', ) ); /** Banner Label */ $wp_customize->add_setting( 'banner_label', array( 'default' => __( 'Discover More', 'business-coach' ), 'sanitize_callback' => 'sanitize_text_field', 'transport' => 'postMessage' ) ); $wp_customize->add_control( 'banner_label', array( 'label' => __( 'Button Label', 'business-coach' ), 'section' => 'header_image', 'type' => 'text', 'active_callback' => 'vandana_lite_banner_ac' ) ); $wp_customize->selective_refresh->add_partial( 'banner_label', array( 'selector' => '.site-banner .banner-caption .banner-text', 'render_callback' => 'business_coach_get_banner_label', ) ); /** Banner Link */ $wp_customize->add_setting( 'banner_link', array( 'default' => '#', 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( 'banner_link', array( 'label' => __( 'Button Link', 'business-coach' ), 'section' => 'header_image', 'type' => 'text', 'active_callback' => 'vandana_lite_banner_ac' ) ); /** Enable Notification Bar */ $wp_customize->add_setting( 'ed_banner_open_new_target', array( 'default' => false, 'sanitize_callback' => 'vandana_lite_sanitize_checkbox' ) ); $wp_customize->add_control( new Vandana_Lite_Toggle_Control( $wp_customize, 'ed_banner_open_new_target', array( 'section' => 'header_image', 'label' => __( 'Enable to open in new window', 'business-coach' ), 'description' => __( 'Enable/Disable to show the url to go in next window', 'business-coach' ), 'active_callback' => 'vandana_lite_banner_ac', ) ) ); /* Image Alignment */ $wp_customize->add_setting( 'banner_image_alignment', array( 'default' => 'left', 'sanitize_callback' => 'vandana_lite_sanitize_radio' ) ); $wp_customize->add_control( new Business_Coach_Radio_Buttonset_Control( $wp_customize, 'banner_image_alignment', array( 'section' => 'header_image', 'label' => __( 'Banner Image Alignment', 'business-coach' ), 'description' => __( 'Choose alignment for banner image.', 'business-coach' ), 'choices' => array( 'left' => __( 'Left', 'business-coach' ), 'right' => __( 'Right', 'business-coach' ), ), 'active_callback' => 'vandana_lite_banner_ac' ) ) ); /* Caption Alignment */ $wp_customize->add_setting( 'banner_caption_layout', array( 'default' => 'right', 'sanitize_callback' => 'vandana_lite_sanitize_radio' ) ); $wp_customize->add_control( new Business_Coach_Radio_Buttonset_Control( $wp_customize, 'banner_caption_layout', array( 'section' => 'header_image', 'label' => __( 'Banner Caption Alignment', 'business-coach' ), 'description' => __( 'Choose alignment for banner caption.', 'business-coach' ), 'choices' => array( 'left' => __( 'Left', 'business-coach' ), 'centered' => __( 'Center', 'business-coach' ), 'right' => __( 'Right', 'business-coach' ), ), 'active_callback' => 'vandana_lite_banner_ac' ) ) ); /** Appearance */ $wp_customize->add_panel( 'appearance_settings', array( 'title' => __( 'Appearance Settings', 'business-coach' ), 'priority' => 25, 'capability' => 'edit_theme_options', 'description' => __( 'Change color and body background.', 'business-coach' ), ) ); /** Typography */ $wp_customize->add_section( 'typography_settings', array( 'title' => __( 'Typography', 'business-coach' ), 'priority' => 20, 'panel' => 'appearance_settings', ) ); /** Primary Font */ $wp_customize->add_setting( 'primary_font', array( 'default' => 'Open Sans', 'sanitize_callback' => 'vandana_lite_sanitize_select' ) ); $wp_customize->add_control( new Vandana_Lite_Select_Control( $wp_customize, 'primary_font', array( 'label' => __( 'Primary Font', 'business-coach' ), 'description' => __( 'Primary font of the site.', 'business-coach' ), 'section' => 'typography_settings', 'choices' => vandana_lite_get_all_fonts(), ) ) ); /** Secondary Font */ $wp_customize->add_setting( 'secondary_font', array( 'default' => 'Zilla Slab', 'sanitize_callback' => 'vandana_lite_sanitize_select' ) ); $wp_customize->add_control( new Vandana_Lite_Select_Control( $wp_customize, 'secondary_font', array( 'label' => __( 'Secondary Font', 'business-coach' ), 'description' => __( 'Secondary font of the site.', 'business-coach' ), 'section' => 'typography_settings', 'choices' => vandana_lite_get_all_fonts(), ) ) ); /** Font Size*/ $wp_customize->add_setting( 'font_size', array( 'default' => 18, 'sanitize_callback' => 'vandana_lite_sanitize_number_absint' ) ); $wp_customize->add_control( new Vandana_Lite_Slider_Control( $wp_customize, 'font_size', array( 'section' => 'typography_settings', 'label' => __( 'Font Size', 'business-coach' ), 'description' => __( 'Change the font size of your site.', 'business-coach' ), '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; } add_action( 'customize_register', 'business_coach_customizer_register', 40 ); /** * Returns Home Sections */ function vandana_lite_get_home_sections(){ $ed_banner = get_theme_mod( 'ed_banner_section', 'static_nl_banner' ); $sections = array( 'client' => array( 'sidebar' => 'client' ), 'about' => array( 'section' => 'about' ), 'promotional' => array( 'sidebar' => 'promotional' ), 'service' => array( 'sidebar' => 'service' ), 'cta' => array( 'sidebar' => 'cta' ), 'testimonial' => array( 'sidebar' => 'testimonial' ), 'blog' => array( 'section' => 'blog' ), 'contact' => array( 'sidebar' => 'contact' ), ); $enabled_section = array(); if( $ed_banner == 'slider_banner' || $ed_banner == 'static_nl_banner' || $ed_banner == 'static_banner' ) array_push( $enabled_section, 'banner' ); foreach( $sections as $k => $v ){ if( array_key_exists( 'sidebar', $v ) ){ if( is_active_sidebar( $v['sidebar'] ) ) array_push( $enabled_section, $v['sidebar'] ); }else{ if( get_theme_mod( 'ed_' . $v['section'] . '_section', true ) ) array_push( $enabled_section, $v['section'] ); } } return apply_filters( 'vandana_lite_home_sections', $enabled_section ); } /** * Header Contact */ function business_coach_header_contact( $echo = true, $layout = true ){ $phone = get_theme_mod( 'phone', '+123-456-7890' ); $email = get_theme_mod( 'email', 'mail@domain.com' ); if( $echo && ( !empty( $phone ) || !empty( $email ) ) ) : if( !empty( $phone ) ) : ?>
'. esc_html( $phone ).''; ?>
' . sanitize_email( $email ) . ''; ?>
'Halant', 'variant'=>'700' ) ); $ig_site_title_font = vandana_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', 'business-coach' ); $secondary = _x( 'on', 'Secondary Font: on or off', 'business-coach' ); $site_title = _x( 'on', 'Site Title Font: on or off', 'business-coach' ); if ( 'off' !== $primary || 'off' !== $secondary || 'off' !== $site_title ) { $font_families = array(); if ( 'off' !== $primary && $ig_primary_font ) { $primary_variant = vandana_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 = vandana_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 = ':' . vandana_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 ); } function business_coach_dynamic_css(){ $primary_font = get_theme_mod( 'primary_font', 'Open Sans' ); $primary_fonts = vandana_lite_get_fonts( $primary_font, 'regular' ); $secondary_font = get_theme_mod( 'secondary_font', 'Zilla Slab' ); $secondary_fonts = vandana_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'=>'Halant', 'variant'=>'700' ) ); $site_title_fonts = vandana_lite_get_fonts( $site_title_font['font-family'], $site_title_font['variant'] ); $site_title_font_size = get_theme_mod( 'site_title_font_size', 30 ); $site_title_color = get_theme_mod( 'site_title_color', '#111111' ); $site_logo_size = get_theme_mod( 'site_logo_size', 70 ); $cta_bg = get_theme_mod( 'cta_bg', esc_url( get_template_directory_uri() . '/images/flower-bg.png' ) ); $blog_bg = get_theme_mod( 'blog_bg', esc_url( get_template_directory_uri() . '/images/blog-section-flower-bg.png' ) ); echo ""; } add_action( 'wp_head', 'business_coach_dynamic_css', 99 );