Forked from lots0logs/child-theme-functions-php-snippet.php
Created
April 5, 2017 08:39
-
-
Save phirebase/cbf4e33cefbf7495923e9a5eea4f333a to your computer and use it in GitHub Desktop.
WordPress :: Divi Theme :: Disable Default Open Sans Font
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* DON'T copy the first line (above) if your functions.php already has it. | |
* ---------------------------------------------------------------------- */ | |
function et_divi_fonts_url() { | |
$fonts_url = ''; | |
/* Translators: If there are characters in your language that are not | |
* supported by Open Sans, translate this to 'off'. Do not translate | |
* into your own language. | |
*/ | |
$open_sans = _x( 'off', 'Open Sans font: on or off', 'Divi' ); | |
if ( 'off' !== $open_sans ) { | |
$font_families = array(); | |
if ( 'off' !== $open_sans ) | |
$font_families[] = 'Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800'; | |
$protocol = is_ssl() ? 'https' : 'http'; | |
$query_args = array( | |
'family' => implode( '%7C', $font_families ), | |
'subset' => 'latin,latin-ext', | |
); | |
$fonts_url = add_query_arg( $query_args, "$protocol://fonts.googleapis.com/css" ); | |
} | |
return $fonts_url; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment