Add Google Fonts To Your Theme In WordPress

To use Google Fonts in your theme, the standard way to add the fonts is WordPress hooks.

Add code below to your functions.php file to load Google Fonts in your theme.

if (!function_exists('hs_google_fonts')) {
    function hs_google_fonts()
    {
        wp_enqueue_style('custom-google-fonts', 'https://fonts.googleapis.com/css2?family=Lato&display=swap', false);
    }
    add_action('wp_enqueue_scripts', 'hs_google_fonts');
}

In this example we added “Lato” Google Font yo our theme.

Shopping Cart