Skip to content

Instantly share code, notes, and snippets.

@aslamnd
Forked from gregrickaby/functions.php
Last active August 29, 2015 14:09
Show Gist options
  • Save aslamnd/dfa9f5ddf5b49c5a8a91 to your computer and use it in GitHub Desktop.
Save aslamnd/dfa9f5ddf5b49c5a8a91 to your computer and use it in GitHub Desktop.
<?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