Skip to content

Instantly share code, notes, and snippets.

@stalukder03
Forked from kailoon/google_font.php
Created November 20, 2017 22:56
Show Gist options
  • Save stalukder03/4f8b51e399923ba80ee8fe3e10d5ed0d to your computer and use it in GitHub Desktop.
Save stalukder03/4f8b51e399923ba80ee8fe3e10d5ed0d to your computer and use it in GitHub Desktop.
<?php
/*
Register Fonts
*/
function studio_fonts_url() {
$font_url = '';
/*
Translators: If there are characters in your language that are not supported
by chosen font(s), translate this to 'off'. Do not translate into your own language.
*/
if ( 'off' !== _x( 'on', 'Google font: on or off', 'studio' ) ) {
$font_url = add_query_arg( 'family', urlencode( 'Montserrat|Bowlby One|Quattrocento Sans:400,400italic,700italic,700&subset=latin,latin-ext' ), "//fonts.googleapis.com/css" );
}
return $font_url;
}
/*
Enqueue scripts and styles.
*/
function studio_scripts() {
wp_enqueue_style( 'studio-fonts', studio_fonts_url(), array(), '1.0.0' );
}
add_action( 'wp_enqueue_scripts', 'studio_scripts' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment