/** * Enqueue Google Fonts Example */ function customizer_topshop_theme_fonts() { // Font options $fonts = array(get_theme_mod('topshop-body-font', customizer_library_get_default('topshop-body-font')), get_theme_mod('topshop-heading-font', customizer_library_get_default('topshop-heading-font'))); $font_uri = customizer_library_get_google_font_uri($fonts); // Load Google Fonts wp_enqueue_style('customizer_topshop_theme_fonts', $font_uri, array(), null, 'screen'); }
/** * Enqueue Google Fonts Example */ function smtm_fonts() { // Font options $fonts = array(get_theme_mod('primary-font', customizer_library_get_default('primary-font')), get_theme_mod('secondary-font', customizer_library_get_default('secondary-font')), get_theme_mod('tertiary-font', customizer_library_get_default('tertiary-font'))); $font_uri = customizer_library_get_google_font_uri($fonts); // Load Google Fonts wp_enqueue_style('smtm_fonts', $font_uri, array(), null, 'screen'); }
function bfg_customizer_fonts() { // Font options $fonts = array(get_theme_mod('heading-font', customizer_library_get_default('heading-font')), get_theme_mod('body-font', customizer_library_get_default('heading-font'))); $font_uri = customizer_library_get_google_font_uri($fonts); if (get_theme_mod('custom-font', false)) { // Load Google Fonts wp_enqueue_style('customizer-fonts', $font_uri, array(), null, 'screen'); // Remove default font enqueue remove_action('wp_enqueue_scripts', 'bfg_google_fonts'); } }
/** * Build the HTTP request URL for Google Fonts. * * @since 1.0.0. * * @return string The URL for including Google Fonts. */ function optimizer_google_fonts() { global $optimizer; if (!empty($optimizer['content_font_id']['font-family'])) { $content_font_id = $optimizer['content_font_id']['font-family']; } else { $content_font_id = ''; } if (!empty($optimizer['logo_font_id']['font-family'])) { $logo_font_id = $optimizer['logo_font_id']['font-family']; } else { $logo_font_id = ''; } if (!empty($optimizer['ptitle_font_id']['font-family'])) { $ptitle_font_id = $optimizer['ptitle_font_id']['font-family']; } else { $ptitle_font_id = ''; } // Font options $fonts = array($content_font_id, $logo_font_id, $ptitle_font_id); $font_uri = customizer_library_get_google_font_uri($fonts); // Load Google Fonts wp_enqueue_style('optimizer_google_fonts', $font_uri, array(), null, 'screen'); }
/** * Build the HTTP request URL for Google Fonts. * * @since 1.0.0. * * @return string The URL for including Google Fonts. */ function optimizer_google_fonts() { global $optimizer; // Font options $fonts = array($optimizer['content_font_id']['font-family'], $optimizer['logo_font_id']['font-family'], $optimizer['ptitle_font_id']['font-family']); $font_uri = customizer_library_get_google_font_uri($fonts); // Load Google Fonts wp_enqueue_style('optimizer_google_fonts', $font_uri, array(), null, 'screen'); }
/** * Enqueue fonts. */ function gather_fonts() { // Font options $fonts = array(); // Site title font only required when logo not in use if (!get_theme_mod('logo', 0)) { $fonts[0] = get_theme_mod('site-title-font', customizer_library_get_default('site-title-font')); } $fonts[1] = get_theme_mod('primary-font', customizer_library_get_default('primary-font')); $fonts[2] = get_theme_mod('secondary-font', customizer_library_get_default('secondary-font')); $font_uri = customizer_library_get_google_font_uri($fonts); // Load Google Fonts wp_enqueue_style('gather-body-fonts', $font_uri, array(), null, 'screen'); // Icon Font wp_enqueue_style('gather-icons', get_template_directory_uri() . '/fonts/gather-icons.css', array(), '0.4.0'); }