Skip to content

Instantly share code, notes, and snippets.

@jennimckinnon
Last active January 31, 2024 17:46
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save jennimckinnon/a65d307e9a3fcf8faa5e to your computer and use it in GitHub Desktop.
Save jennimckinnon/a65d307e9a3fcf8faa5e to your computer and use it in GitHub Desktop.
function google_fonts() {
$query_args = array(
'family' => 'Open+Sans:400,700|Oswald:700'
'subset' => 'latin,latin-ext',
);
wp_register_style( 'google_fonts', add_query_arg( $query_args, "//fonts.googleapis.com/css" ), array(), null );
}
add_action('wp_enqueue_scripts', 'google_fonts');
@hocu
Copy link

hocu commented Nov 11, 2015

There should be a comma "," between items in $query_args array, not at the end:

'family' => 'Open+Sans:400,700|Oswald:700',
        'subset' => 'latin,latin-ext'

@Thomas-A-Reinert
Copy link

@hocu Yup, I can confirm that. The above example will throw an error, your´s won´t. Thx.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment