Skip to content Skip to sidebar Skip to footer

Wordpress - Google Fonts Not Working / Importing Correctly

I'm quite new to Wordpress and I'm importing my stylesheets across using the html5blank theme. I've noticed the google fonts aren't applying in the wordpress site. I have this lin

Solution 1:

Are you telling wp to load the stlye.css file?

Try doing this to your functions.php file:

function load_styles() {
  wp_enqueue_style('styles', 'path/to/style.css');
}

followed by (if your styles are for the site's front-end):

add_action('wp_enqueue_scripts', 'load_styles');

or (if your styles are for the site's admin panel):

add_action('admin_enqueue_scripts', 'load_styles');

Also, you're adding the fonts twice by doing:

<link href='https://fonts.googleapis.com/css?family=Merriweather+Sans:100,200,400,700,700i,800,800i' rel='stylesheet'type='text/css' />

in your header and:

@import url('https://fonts.googleapis.com/css?family=Merriweather+Sans:100,200,400,700,700i,800,800i');

in your style.css

Choose either one of those, or you can add it to the "load_styles()" function in your functions.php file:

function load_styles() {
  wp_enqueue_style('styles', 'path/to/style.css');
  wp_enqueue_style('fonts', 'https://fonts.googleapis.com/css?family=Merriweather+Sans:100,200,400,700,700i,800,800i');
}

If this doesn't work, please provide more information such as:

  • Are there errors on your browser's developer console?

  • Are the css rules showing up in the dev console?

  • Are the fonts being loaded?

Post a Comment for "Wordpress - Google Fonts Not Working / Importing Correctly"