[resolved] [Twenty Twelve] Google Fonts (8 posts)

  1. markhem
    Posted 2 years ago #

    I have read the threads in the forum on Google fonts in the twenty twelve theme. There are a number of explanations with various outcomes; threads that jump, threads that end suddenly, mis-information, and conflicting methods. All of which are appreciated, but I'm a little confused.

    Can someone please explain the basic process of how to change the Google fonts? I'd like to use Google fonts to do it because I want to learn this method.

    I want to use only two fonts;
    Font_A for all my headers
    Font_B for all other text.

    I have a child theme on my localhost. I am able to work in the functions.php file, and do the styling in the style.css.

    Thank You.

  2. esmi
    Forum Moderator
    Posted 2 years ago #

    Do not edit the theme itself. First create a child theme for your changes.

  3. Joel Williams
    Posted 2 years ago #

    The way I would do it is in your child theme style.css add the imports for the fonts you want to use. Say you wanted to use Rationale and Underdog, at the top of the CSS enter

    @import url(http://fonts.googleapis.com/css?family=Rationale|Underdog);

    Then use them:

    body.custom-font-enabled {
    font-family: 'Rationale', sans-serif;
    h1, h2, h3, h4, h5, h6 {
    font-family: 'Underdog', cursive;

    You may need to do h1, h2 etc individually if you want to control the sizes. Also depending on how specific the CSS is in this theme you may need to target other selectors.

  4. markhem
    Posted 2 years ago #

    Thank you.

    Thanks Joel for your explanation. I take it this gets around the need to dequeue Open Sans?

  5. Joel Williams
    Posted 2 years ago #

    Yes, well it overrides it. You might want to dequeue it anyway as you're loading a font you're not using so there will be some speed benefit to not loading it, but you don't have to.

  6. markhem
    Posted 2 years ago #

    Okay. thanks. I did it and it worked, as you knew it would.

    By the way, 'Underdog', cursive; is a very cool font.

  7. Joel Williams
    Posted 2 years ago #


    I just chose that font at random, but glad you like it :)

  8. markhem
    Posted 2 years ago #

    In case anyone is interested I found this article that outlines the speicific text selectors to target in css.

    Changing fonts for twenty twelve theme

Topic Closed

This topic has been closed to new replies.

About this Topic