Simply including google fonts in your head.php file is a mistake
To connect Google fonts, it is correct to use the WordPress function for connecting style files wp_enqueque_style
Find our Google fonts, or get their code on https://fonts.google.com/
For example, connect fonts:
<link rel="preconnect" href="https://fonts.gstatic.com"> <link href="https://fonts.googleapis.com/css2?family=Oswald:wght@400;500;600;700&family=Rubik&display=swap" rel="stylesheet">
Let’s write a function that will create a fonts link. Add the code below to function.php
<?php function create_urls() { $fonts_url = ''; $families = array(); $families[] = 'Oswald:wght@400;500;600;700'; $families[] = 'Rubik'; $query_args = array( 'family' => urlencode(implode('|', $families)), ); $fonts_url = add_query_arg($query_args, 'https://fonts.googleapis.com/css'); return esc_url_raw($fonts_url); } ?>
Load our create_urls() function having added in function.php code
<?php wp_enqueue_style('mytheme-fonts', create_urls(), array(), '1.0' ); ?>
If you use Redux it has a special field where you can select text and it will be automatically loaded.