0

Just as the title suggests...I tried using an absolute path:

stylesheets[all][] = 'http://fonts.googleapis.com/css?family=Lato:300,400,700,900'

This doesn't work...how do I add this to a theme?

1
  • On the off-chance you have the fontyourface module installed, you can still use the .info file with something like fonts[google_fonts_api][] = Archivo Black&subset=latin#regular
    – Clive
    Mar 25, 2014 at 18:13

1 Answer 1

2

You can add it in the theme template.php file.

function YOURTHEME_preprocess_html(&$vars) {

      // Load font
      drupal_add_css('//fonts.googleapis.com/css?family=Lato:300,400,700,900', array(
        'type' => 'external'
      ));

}

Tip: Dont set a protocol to load external resources from Google

1
  • I was afraid of that...I was hoping to keep all the assets in the info file but I guess I'll do it in the template now. :) thanks again. Mar 25, 2014 at 17:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.