-
-
Save aslamnd/dfa9f5ddf5b49c5a8a91 to your computer and use it in GitHub Desktop.
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
<?php | |
add_action( 'wp_enqueue_scripts', 'child_load_google_fonts' ); | |
/** | |
* Enqueue Google Fonts using a function | |
*/ | |
function child_load_google_fonts() { | |
// Setup font arguments | |
$query_args = array( | |
'family' => 'Open+Sans:300,400,700' // Change this font to whatever font you'd like | |
); | |
// A safe way to register a CSS style file for later use | |
wp_register_style( 'google-fonts', add_query_arg( $query_args, "//fonts.googleapis.com/css" ), array(), null ); | |
// A safe way to add/enqueue a CSS style file to a WordPress generated page | |
wp_enqueue_style( 'google-fonts' ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment