metro add google fonts

Community Forums Forums General Discussion metro add google fonts

This topic is: not resolved

This topic contains 4 replies, has 4 voices, and was last updated by  Bill Murray 1 year, 3 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #18009

    jamesalex
    Participant
    Post count: 14

    How do I import the google fonts onto the metro theme please?

     

    Kind regards

    Jamie

    #18019

    Peter
    Participant
    Post count: 76

    Add the following line at the top of the style.css file, just before the 01 Defaults section;

    [css]@import url(‘http://fonts.googleapis.com/css?family=YourFont’);[/css]


    Website: petercoughlin.com
    Twitter: petercoughlin

    #18433

    jamesalex
    Participant
    Post count: 14

    Hi

     

    Many thanks, although it doesnt seem to be working on this theme, in the functions.php file there is a google font upload text that I am not familiar with.

     

    Kind regards

    Jamie

    #40227

    bleubeard
    Participant
    Post count: 3

    Hey Jamie,

    Did you ever figure this out?

    #40234

    Bill Murray
    Participant
    Post count: 575

    @bleubeard – Is this an issue for you as well?

    The advice Peter gave is accurate. You can add Google fonts by either a) using an @import rule in the stylesheet (Peter’s advice) OR b) using wp_enqueue_style() in your child theme’s functions.php. In other words, do 1 or the other, not both.

    Metro uses method (b). You can stick with that or change it.

    All you need to change is the URL. This is the value that is in single quotes in Peter’s example. It’s the 2nd parameter of the call to wp_enqueue_style() in the Metro functions.php. You get that URL from Google’s web fonts site based on the fonts you want to load.

    Peter’s method is safer, because a typo in CSS won’t break your site, but a typo in your functions.php will.


    Web: https://wpperform.com or Twitter: @wpperform

    We do managed WordPress hosting.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.