Skip to content

Instantly share code, notes, and snippets.

@wpsmith
Forked from gregrickaby/functions.php
Created January 3, 2013 15:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wpsmith/4444219 to your computer and use it in GitHub Desktop.
Save wpsmith/4444219 to your computer and use it in GitHub Desktop.
add_action( 'wp_enqueue_scripts', 'child_load_google_font' );
/**
* Enqueue Google Font
*
* @author Greg Rickaby
* @since 1.0
*/
function child_load_google_font() {
$protocol = is_ssl() ? 'https' : 'http';
$query_args = array(
'family' => '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