Skip to content

Instantly share code, notes, and snippets.

@SriniBlog
Created December 25, 2015 07:20
Show Gist options
  • Save SriniBlog/56517bcbd09a601ca0ed to your computer and use it in GitHub Desktop.
Save SriniBlog/56517bcbd09a601ca0ed to your computer and use it in GitHub Desktop.
This code snippet is used in functions.php file to add the google font in the head section. This works for wordpress with genesis framework
//Add the below code to functions.php file
/*
* OUTPUT in HTML file
* <link rel="stylesheet" id="google-fonts-css" href="//fonts.googleapis.com/css?family=Raleway%3A300%2C700%7CLato%3A700%2C400italic%2C400&amp;ver=1.0.0" type="text/css" media="all">
*/
// Enqueue Google Fonts
add_action( 'wp_enqueue_scripts', 'genesis_sample_google_fonts' );
function genesis_sample_google_fonts() {
wp_enqueue_style( 'google-fonts', '//fonts.googleapis.com/css?family=Raleway:300,700|Lato:700,400italic,400', array(), CHILD_THEME_VERSION );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment