Skip to content

Instantly share code, notes, and snippets.

@WebEndevSnippets
Last active December 11, 2015 08:28
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 WebEndevSnippets/4572908 to your computer and use it in GitHub Desktop.
Save WebEndevSnippets/4572908 to your computer and use it in GitHub Desktop.
WordPress: Load Google Fonts
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