Enqueuing Google Web Fonts the usual way, i.e., using the wp_enqueue_style
function like so...
function wpse_google_webfonts() {
wp_enqueue_style( 'google-webfonts', 'http://fonts.googleapis.com/css?family=Ubuntu+Condensed|Open+Sans:400italic,700italic,400,700' );
}
add_action( 'wp_enqueue_scripts', 'wpse_google_webfonts' );
...results in a link
tag placed in the header like so:
<link rel='stylesheet' id='google-webfonts-css' href='http://fonts.googleapis.com/css?family=Ubuntu+Condensed%7COpen+Sans%3A400italic%2C700italic%2C400%2C700&ver=3.5' type='text/css' media='all' />
As you can see, the resultant URL is encoded.
I am pretty sure it poses no problems, but to keep things clean and clear, I would like to go ahead and ask -- Is there a way to enqueue Google Web Fonts (via functions.php
and not a plugin) in a way that the URL output is not encoded?
That's like so:
<link rel='stylesheet' id='google-webfonts-css' href='http://fonts.googleapis.com/css?family=Ubuntu+Condensed|Open+Sans:400italic,700italic,400,700?ver=3.5' type='text/css' media='all' />
Reason For Bounty
@webaware's answer is near perfect, especially because it's similar to the method employed in enqueuing 'Open Sans' Google Web Font in the Twenty Twelve theme.
The only problem in the output is that it's like this:
<link rel='stylesheet' id='twentytwelve-fonts-css' href='http://fonts.googleapis.com/css?family=Ubuntu+Condensed|Open+Sans:400italic,700italic,400,700&subset=latin,latin-ext' type='text/css' media='all' />
Notice the &
? It should be &
, otherwise the font-files served only have the latin
glyphs (i.e. the subset
parameter in the URL is neglected unless you use &
and NOT its HTML entity).
Anyone who can help modify @webaware's answer so that the output's looks like this...
<link rel='stylesheet' id='twentytwelve-fonts-css' href='http://fonts.googleapis.com/css?family=Ubuntu+Condensed|Open+Sans:400italic,700italic,400,700&subset=latin,latin-ext' type='text/css' media='all' />
...wins the bounty.