I have enqueued google fonts in the usual way in functions.php:
function travellers_field_guide_scripts()
{
wp_enqueue_style('travellers-field-guide-style', get_stylesheet_uri(), array(), _S_VERSION);
wp_enqueue_style('googlefont_css', 'https://fonts.googleapis.com/css2?family=Alata&family=Lato:wght@300;400;700;900&display=swap', false);
}
add_action('wp_enqueue_scripts', 'travellers_field_guide_scripts');
However, upon checking the <head>
all I see is this
<link rel="stylesheet" id="googlefont_css-css" href="https://fonts.googleapis.com/css2?family=Lato%3Awght%40300%3B400%3B700%3B900&display=swap&ver=5.4.2" media="all">
I've resorted to manually adding the link (exactly as I enqueued it) to the fonts in the header, and the fonts are downloaded as expected, but would be nice to know why Wordpress mangles the googlefont when trying to enqueue it. I checked my theme, there is no other reference to googlefont except to enqueue so I'm not doing anything to mangle it.