add_section( 'theme_info', array(
'title' => __( 'Demo & Documentation' , 'blossom-speaker' ),
'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', 'blossom-speaker' ), '', '' );
$theme_info .= '
';
$theme_info .= sprintf( __( 'Documentation Link: %1$sClick here.%2$s', 'blossom-speaker' ), '', '' );
$theme_info .= '
';
$wp_customize->add_control( new Blossom_Coach_Note_Control( $wp_customize,
'theme_info_theme',
array(
'section' => 'theme_info',
'description' => $theme_info
)
)
);
/** Site Title Font */
$wp_customize->add_setting(
'site_title_font',
array(
'default' => array(
'font-family' => 'Montserrat',
'variant' => '700',
),
'sanitize_callback' => array( 'Blossom_Coach_Fonts', 'sanitize_typography' )
)
);
$wp_customize->add_control(
new Blossom_Coach_Typography_Control(
$wp_customize,
'site_title_font',
array(
'label' => __( 'Site Title Font', 'blossom-speaker' ),
'description' => __( 'Site title and tagline font.', 'blossom-speaker' ),
'section' => 'title_tagline',
'priority' => 60,
)
)
);
/** Site Title Font Size*/
$wp_customize->add_setting(
'site_title_font_size',
array(
'default' => 40,
'sanitize_callback' => 'blossom_coach_sanitize_number_absint'
)
);
$wp_customize->add_control(
new Blossom_Coach_Slider_Control(
$wp_customize,
'site_title_font_size',
array(
'section' => 'title_tagline',
'label' => __( 'Site Title Font Size', 'blossom-speaker' ),
'description' => __( 'Change the font size of your site title.', 'blossom-speaker' ),
'priority' => 65,
'choices' => array(
'min' => 10,
'max' => 200,
'step' => 1,
)
)
)
);
/** Typography */
$wp_customize->add_section(
'typography_settings',
array(
'title' => __( 'Typography', 'blossom-speaker' ),
'priority' => 20,
'panel' => 'appearance_settings',
)
);
/** Primary Font */
$wp_customize->add_setting(
'primary_font',
array(
'default' => 'Open Sans',
'sanitize_callback' => 'blossom_coach_sanitize_select'
)
);
$wp_customize->add_control(
new Blossom_Coach_Select_Control(
$wp_customize,
'primary_font',
array(
'label' => __( 'Primary Font', 'blossom-speaker' ),
'description' => __( 'Primary font of the site.', 'blossom-speaker' ),
'section' => 'typography_settings',
'choices' => blossom_coach_get_all_fonts(),
)
)
);
/** Secondary Font */
$wp_customize->add_setting(
'secondary_font',
array(
'default' => 'Montserrat',
'sanitize_callback' => 'blossom_coach_sanitize_select'
)
);
$wp_customize->add_control(
new Blossom_Coach_Select_Control(
$wp_customize,
'secondary_font',
array(
'label' => __( 'Secondary Font', 'blossom-speaker' ),
'description' => __( 'Secondary font of the site.', 'blossom-speaker' ),
'section' => 'typography_settings',
'choices' => blossom_coach_get_all_fonts(),
)
)
);
}
add_action( 'customize_register', 'blossom_speaker_customize_register', 40 );
function blossom_speaker_remove_header_customize_register() {
global $wp_customize;
$wp_customize->remove_setting( 'phone' );
$wp_customize->remove_control( 'phone' );
$wp_customize->remove_setting( 'email' );
$wp_customize->remove_control( 'email' );
}
add_action( 'customize_register', 'blossom_speaker_remove_header_customize_register', 1000 );
function blossom_speaker_site_branding() {
$site_title = get_bloginfo( 'name' );
$site_description = get_bloginfo( 'description', 'display' );
$header_text = get_theme_mod( 'header_text', 1 );
$branding_class = '';
if( has_custom_logo() || $site_title || $site_description || $header_text ) :
if( has_custom_logo() && ( $site_title || $site_description ) && $header_text ) {
$branding_class = ' icon-text';
}else{
$branding_class = '';
} ?>
';
the_custom_logo();
echo '
';
}
?>
';
if ( is_front_page() ) : ?>
';
endif; ?>
array( 'sidebar' => 'service' ),
'about' => array( 'sidebar' => 'about' ),
'cta' => array( 'sidebar' => 'cta' ),
'testimonial' => array( 'sidebar' => 'testimonial' ),
'client' => array( 'sidebar' => 'client' ),
'blog' => array( 'section' => 'blog' ),
'simple-cta' => array( 'sidebar' => 'simple-cta' ),
'contact' => array( 'sidebar' => 'contact' ),
);
$enabled_section = array();
if( $ed_banner == 'static_nl_banner' || $ed_banner == 'slider_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( 'blossom_coach_home_sections', $enabled_section );
}
/** Blossom Coach Fonts URL */
function blossom_coach_fonts_url(){
$fonts_url = '';
$primary_font = get_theme_mod( 'primary_font', 'Open Sans' );
$ig_primary_font = blossom_coach_is_google_font( $primary_font );
$secondary_font = get_theme_mod( 'secondary_font', 'Montserrat' );
$ig_secondary_font = blossom_coach_is_google_font( $secondary_font );
$site_title_font = get_theme_mod( 'site_title_font', array( 'font-family'=>'Montserrat', 'variant'=>'700' ) );
$ig_site_title_font = blossom_coach_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', 'blossom-speaker' );
$secondary = _x( 'on', 'Secondary Font: on or off', 'blossom-speaker' );
$site_title = _x( 'on', 'Site Title Font: on or off', 'blossom-speaker' );
if ( 'off' !== $primary || 'off' !== $secondary || 'off' !== $site_title ) {
$font_families = array();
if ( 'off' !== $primary && $ig_primary_font ) {
$primary_variant = blossom_coach_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 = blossom_coach_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 = ':' . blossom_coach_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 blossom_speaker_dynamic_css(){
$primary_font = get_theme_mod( 'primary_font', 'Open Sans' );
$primary_fonts = blossom_coach_get_fonts( $primary_font, 'regular' );
$secondary_font = get_theme_mod( 'secondary_font', 'Montserrat' );
$secondary_fonts = blossom_coach_get_fonts( $secondary_font, 'regular' );
$site_title_font = get_theme_mod( 'site_title_font', array( 'font-family'=>'Montserrat', 'variant'=>'700' ) );
$site_title_fonts = blossom_coach_get_fonts( $site_title_font['font-family'], $site_title_font['variant'] );
$site_title_font_size = get_theme_mod( 'site_title_font_size', 40 );
echo "";
}
add_action( 'wp_head', 'blossom_speaker_dynamic_css', 100 );
function blossom_coach_footer_bottom(){ ?>