add_section( 'theme_info', array( 'title' => __( 'Information Links', 'coachpress-health' ), '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', 'coachpress-health' ), '', '' ); $theme_info .= '

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

'; $wp_customize->add_control( new CoachPress_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', 'coachpress-health' ), 'priority' => 10, 'panel' => 'layout_settings', ) ); /** Header layout */ $wp_customize->add_setting( 'header_layout', array( 'default' => 'four', 'sanitize_callback' => 'coachpress_lite_sanitize_radio' ) ); $wp_customize->add_control( new CoachPress_Lite_Radio_Image_Control( $wp_customize, 'header_layout', array( 'section' => 'header_layout_settings', 'label' => __( 'Header Layout', 'coachpress-health' ), 'description' => __( 'Choose the layout of the header for your site.', 'coachpress-health' ), 'choices' => array( 'one' => get_stylesheet_directory_uri() . '/images/header/one.jpg', 'four' => get_stylesheet_directory_uri() . '/images/header/four.jpg', ) ) ) ); /** Static Banner Layout Settings */ $wp_customize->add_section( 'cta_static_banner_layout_settings', array( 'title' => __( 'CTA Static Banner Layout', 'coachpress-health' ), 'priority' => 30, 'panel' => 'layout_settings', ) ); $wp_customize->add_setting( 'cta_static_banner_layout', array( 'default' => 'one', 'sanitize_callback' => 'coachpress_lite_sanitize_radio' ) ); $wp_customize->add_control( new CoachPress_Lite_Radio_Image_Control( $wp_customize, 'cta_static_banner_layout', array( 'section' => 'cta_static_banner_layout_settings', 'label' => __( 'CTA Static Banner Layout', 'coachpress-health' ), 'description' => __( 'Choose the layout of the cta static banner for your site.', 'coachpress-health' ), 'choices' => array( 'one' => get_stylesheet_directory_uri() . '/images/static_banner/cta_one.jpg', 'two' => get_stylesheet_directory_uri() . '/images/static_banner/cta_two.jpg', ) ) ) ); $wp_customize->add_panel( 'appearance_settings', array( 'title' => __( 'Appearance Settings', 'coachpress-health' ), 'priority' => 25, 'capability' => 'edit_theme_options', 'description' => __( 'Change color and body background.', 'coachpress-health' ), ) ); /** Typography */ $wp_customize->add_section( 'typography_settings', array( 'title' => __( 'Typography', 'coachpress-health' ), 'priority' => 20, 'panel' => 'appearance_settings', ) ); /** Primary Font */ $wp_customize->add_setting( 'primary_font', array( 'default' => array( 'font-family' => 'Nunito Sans', 'variant' => 'regular', ), 'sanitize_callback' => array( 'CoachPress_Lite_Fonts', 'sanitize_typography' ) ) ); $wp_customize->add_control( new CoachPress_Lite_Typography_Control( $wp_customize, 'primary_font', array( 'label' => __( 'Primary Font', 'coachpress-health' ), 'description' => __( 'Primary font of the site.', 'coachpress-health' ), 'section' => 'typography_settings', 'priority' => 5, ) ) ); /** Secondary Font */ $wp_customize->add_setting( 'secondary_font', array( 'default' => 'Karma', 'sanitize_callback' => 'coachpress_lite_sanitize_select' ) ); $wp_customize->add_control( new CoachPress_Lite_Select_Control( $wp_customize, 'secondary_font', array( 'label' => __( 'Secondary Font', 'coachpress-health' ), 'description' => __( 'Secondary font of the site.', 'coachpress-health' ), 'section' => 'typography_settings', 'choices' => coachpress_lite_get_all_fonts(), 'priority' => 5, ) ) ); /** Tertiary Font */ $wp_customize->add_setting( 'tertiary_font', array( 'default' => 'Great Vibes', 'sanitize_callback' => 'coachpress_lite_sanitize_select' ) ); $wp_customize->add_control( new CoachPress_Lite_Select_Control( $wp_customize, 'tertiary_font', array( 'label' => __( 'Tertiary Font', 'coachpress-health' ), 'section' => 'typography_settings', 'choices' => coachpress_lite_get_all_fonts(), ) ) ); /** 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->add_setting( 'header_contact_button', array( 'default' => '', 'sanitize_callback' => 'sanitize_text_field', ) ); $wp_customize->add_control( 'header_contact_button', array( 'label' => __( 'Header Contact Button', 'coachpress-health' ), 'description' => __( 'This button shows only on header layout 2.', 'coachpress-health' ), 'section' => 'header_settings', 'type' => 'text', ) ); $wp_customize->add_setting( 'header_contact_url', array( 'default' => '', 'sanitize_callback' => 'esc_url_raw', ) ); $wp_customize->add_control( 'header_contact_url', array( 'label' => __( 'Header Contact Button', 'coachpress-health' ), 'section' => 'header_settings', 'type' => 'url', ) ); } add_action( 'customize_register', 'coachpress_health_customizer_register', 40 ); /** * Form */ function coachpress_lite_header_contact(){ $phone = get_theme_mod( 'phone' ); $email = get_theme_mod( 'email' ); $header_layout = get_theme_mod( 'header_layout', 'four' ); if ( $header_layout == 'one' ) { $class = 'left'; }else{ $class = 'center'; } if( $phone || $email ) : echo '
'; if( !empty( $phone ) ) echo '
' . esc_html( $phone ) . '
'; if( !empty( $email ) ) echo '
' . sanitize_email( $email ) . '
'; echo '
'; endif; } /** * Header Start */ function coachpress_lite_header(){ $ed_cart = get_theme_mod( 'ed_shopping_cart', true ); $ed_search = get_theme_mod( 'ed_header_search', true ); $header_layout = get_theme_mod( 'header_layout', 'four' ); if ( $header_layout == 'one' ) { $class = 'center'; }else{ $class = 'left'; } ?>
'Nunito Sans', 'variant'=>'regular' ) ); $ig_primary_font = coachpress_lite_is_google_font( $primary_font['font-family'] ); $secondary_font = get_theme_mod( 'secondary_font', 'Karma' ); $ig_secondary_font = coachpress_lite_is_google_font( $secondary_font ); $tertiary_font = get_theme_mod( 'tertiary_font', 'Great Vibes' ); $ig_tertiary_font = coachpress_lite_is_google_font( $tertiary_font ); $site_title_font = get_theme_mod( 'site_title_font', array( 'font-family'=>'Noto Serif', 'variant'=>'regular' ) ); $ig_site_title_font = coachpress_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', 'coachpress-health' ); $secondary = _x( 'on', 'Secondary Font: on or off', 'coachpress-health' ); $tertiary = _x( 'on', 'Tertiary Font: on or off', 'coachpress-health' ); $site_title = _x( 'on', 'Site Title Font: on or off', 'coachpress-health' ); if ( 'off' !== $primary || 'off' !== $secondary || 'off' !== $tertiary || 'off' !== $site_title ) { $font_families = array(); if ( 'off' !== $primary && $ig_primary_font ) { $primary_variant = coachpress_lite_check_varient( $primary_font['font-family'], $primary_font['variant'], true ); if( $primary_variant ){ $primary_var = ':' . $primary_variant; }else{ $primary_var = ''; } $font_families[] = $primary_font['font-family'] . $primary_var; } if ( 'off' !== $secondary && $ig_secondary_font ) { $secondary_variant = coachpress_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' !== $tertiary && $ig_tertiary_font ) { $tertiary_variant = coachpress_lite_check_varient( $tertiary_font, 'regular', true ); if( $tertiary_variant ){ $tertiary_var = ':' . $tertiary_variant; }else{ $tertiary_var = ''; } $font_families[] = $tertiary_font . $tertiary_var; } if ( 'off' !== $site_title && $ig_site_title_font ) { if( ! empty( $site_title_font['variant'] ) ){ $site_title_var = ':' . coachpress_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_raw( $fonts_url ); } /** Dynamic CSS */ function coachpress_health_dynamic_css(){ $primary_font = get_theme_mod( 'primary_font', array( 'font-family'=>'Nunito Sans', 'variant'=>'regular' ) ); $primary_fonts = coachpress_lite_get_fonts( $primary_font['font-family'], $primary_font['variant'] ); $secondary_font = get_theme_mod( 'secondary_font', 'Karma' ); $secondary_fonts = coachpress_lite_get_fonts( $secondary_font, 'regular' ); $tertiary_font = get_theme_mod( 'tertiary_font', 'Great Vibes' ); $tertiary_fonts = coachpress_lite_get_fonts( $tertiary_font, 'regular' ); $font_size = get_theme_mod( 'font_size', 18 ); $site_title_font = get_theme_mod( 'site_title_font', array( 'font-family'=>'Noto Serif', 'variant'=>'regular' ) ); $site_title_fonts = coachpress_lite_get_fonts( $site_title_font['font-family'], $site_title_font['variant'] ); $site_title_font_size = get_theme_mod( 'site_title_font_size', 30 ); $logo_width = get_theme_mod( 'logo_width', 150 ); echo ""; } add_action( 'wp_head', 'coachpress_health_dynamic_css', 99 );