Last active
December 11, 2015 08:28
-
-
Save WebEndevSnippets/4572908 to your computer and use it in GitHub Desktop.
WordPress: Load Google Fonts
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
add_action( 'wp_enqueue_scripts', 'webendev_load_google_font' ); | |
/** | |
* Enqueue Google Fonts | |
* | |
* @author Greg Rickaby | |
* @since 1.0 | |
*/ | |
function webendev_load_google_font() { | |
$protocol = is_ssl() ? 'https' : 'http'; | |
$query_args = array( | |
'family' => 'Oswald|Open+Sans' // Change this to whatever font you'd like | |
); | |
wp_enqueue_style( 'child-fonts', 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