Google Fonts – multiple fonts

Community Forums Forums Design Tips and Tricks Google Fonts – multiple fonts

This topic is: resolved

Tagged: 

This topic contains 3 replies, has 3 voices, and was last updated by  Landon 6 months, 2 weeks ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #92230

    BrendaGaelSmith
    Participant
    Post count: 4

    I am using the Prose theme and wish to load two different Google fonts – a script font for headings and a sans serif font for other text.

    I have successfully added one font via “Custom Code>Custom Functions” and following this tutorial:

    http://my.studiopress.com/tutorials/load-google-fonts/

    However, when I add a second font, the site will not load. What is the best way to load two different Google fonts?

    http://loisparishevans.com
    #92262

    Peter
    Participant
    Post count: 95

    You can use the vertical bar | symbol to list multiple fonts. For example:

    add_action( ‘wp_enqueue_scripts’, ‘sp_load_google_fonts’ );
    function sp_load_google_fonts() {
    wp_enqueue_style( ‘google-font’, ‘//fonts.googleapis.com/css?family=Lato:300,700|Open+Sans:400,700′, array(), CHILD_THEME_VERSION );
    }

    You can add as many fonts as you want, just separate them with a vertical bar |

    #92277

    BrendaGaelSmith
    Participant
    Post count: 4

    Thank you Peter. That works perfectly :-)

    #93468

    Landon
    Participant
    Post count: 64

    Thank you!

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

You must be logged in to reply to this topic.