Last active
December 21, 2015 06:48
-
-
Save purzlbaum/6266422 to your computer and use it in GitHub Desktop.
Adding google fonts only if not on a .loc/.local domain
This file contains hidden or 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
/** | |
* Adding google fonts only if not on a .loc/.local domain | |
* | |
* This is the proper code to add google fonts | |
* as seen in TwentyTwelve | |
* Code partially from: https://github.com/wearerequired/required-foundation | |
*/ | |
if(strpos(!$_SERVER['SERVER_NAME'], '.loc')){ | |
$protocol = is_ssl() ? 'https' : 'http'; | |
$query_args = array( 'family' => 'Gentium+Book+Basic:400,400italic,700|Open+Sans' ); | |
wp_enqueue_style( | |
'open-sans', | |
add_query_arg( $query_args, "$protocol://fonts.googleapis.com/css" ), | |
array(), | |
null | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment