• Hello everyone,

    I realize there are many plugins for this. However, I am looking for a way to directly install 2 Google Fonts I like and then define it in CSS. Is this possible? Please provide me steps to do this. It would be greatly appreciated because I can’t find a good YouTube tutorial to help me out.

    Thanks so much.

    Your Friend in OnePress,
    Brody

    • This topic was modified 8 years, 3 months ago by Jan Dembowski.
Viewing 2 replies - 1 through 2 (of 2 total)
  • There are loads of information showing you how to implement googlefonts into your theme.

    When making any changes to a theme it should be done so via the use of a Child Theme.

    Add this to your functions.php file:

    function custom_googlefonts() {
    	wp_enqueue_style( 'googlefonts', 'https://fonts.googleapis.com/css?family=Raleway|Open+Sans', false );
    }
    add_action('wp_enqueue_scripts', 'custom_googlefonts');

    Which you can reference within your style.css file:

    .classname {
        font-family:"Open Sans", sans-serif;
    }

    Hope this helps.

    Thread Starter beachsand14

    (@beachsand14)

    Cheers @themesumo. I will try out your example. I was able to use 2 google fonts by referencing it in css without installing any additional plugins or any changes to .php. How is this possible? I have the fonts installed on my hard drive. Does that make a difference?

    Does your .php code above ensure that everyone using an eligible browser can see the fonts I choose on their device? Do they have to install the fonts on their own? Additionally, does the function custom_googlefonts() give access to every google font without me having to install it on wordpress?

    Cheers
    Brody James

    • This reply was modified 8 years, 3 months ago by beachsand14.
    • This reply was modified 8 years, 3 months ago by beachsand14.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How do I install 2 Google Fonts?’ is closed to new replies.