1. Go to Google Fonts
2. Choose the font family you want to add
3. Copy the highlighted part
ex: https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,400;0,700;1,400;1,700&display=swap
4. Paste this in your theme’s functions.php
// Enqueue Google Fonts
function roboto_google_fonts() {
wp_enqueue_style( 'roboto-google-fonts', 'https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,400;0,700;1,400;1,700&display=swap', false );
}
add_action( 'wp_enqueue_scripts', 'roboto_google_fonts' );
Replace these if you’re planning to use more Google Fonts in your website.