• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Google Fonts – how to change?

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Google Fonts – how to change?

This topic is: not resolved

Tagged: css2 google fonts, google fonts, new google font code

  • This topic has 3 replies, 3 voices, and was last updated 2 years, 2 months ago by Marcy.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • January 18, 2021 at 9:05 pm #502709
    linzinz
    Participant

    This is the existing google font code in functions for Revolution Pro.

    function revolution_enqueue_scripts_styles() {
    
    	wp_enqueue_style(
    		genesis_get_theme_handle() . '-fonts',
    		'//fonts.googleapis.com/css?family=Noto+Serif+SC:300,600|Playfair+Display:400,700,700i|Poppins:400',
    		[],
    		genesis_get_theme_version()
    	);
    

    I am trying to change fonts but the new Google code looks like this:

    <link rel="preconnect" href="https://fonts.gstatic.com">
    <link href="https://fonts.googleapis.com/css2?family=El+Messiri:[email protected];600&family=Noto+Serif&display=swap" rel="stylesheet"> 

    I am struggling to find the correct way to implement the new code, any advice would be greatly appreciated! Thanks!

    http://local
    January 19, 2021 at 1:56 pm #502718
    Anita
    Keymaster

    The two ways you are showing are different two different methods. If you want to add the fonts using the link method, you can copy the link method into the Genesis > Theme Settings > Header box under the Header and Footer scripts box.


    Love coffee, chocolate and my Bella!

    January 19, 2021 at 3:06 pm #502724
    linzinz
    Participant

    Thanks Anita,

    I will use the original method however I was wondering whether to change to css2 as in the new code and whether the way the font weights are written mattered or needed changing to the new way.

    January 20, 2021 at 3:17 pm #502758
    Marcy
    Participant

    In all versions of Revolution Pro, you can replace Google Fonts in functions.php with new ones.

    It's the section:

    function revolution_enqueue_scripts_styles() {
    
    	wp_enqueue_style(
    		genesis_get_theme_handle() . '-fonts',
    		'//fonts.googleapis.com/css?family=Noto+Serif+SC:300,600|Playfair+Display:400,700,700i|Poppins:400',
    		[],
    		genesis_get_theme_version()
    	);
    /* More functions */
    }

    You will replace:

    wp_enqueue_style(
    		genesis_get_theme_handle() . '-fonts',
    		'//fonts.googleapis.com/css?family=Noto+Serif+SC:300,600|Playfair+Display:400,700,700i|Poppins:400',
    		[],
    		genesis_get_theme_version()
    	);

    with

    wp_enqueue_style(
    		genesis_get_theme_handle() . '-fonts',
    		'//fonts.googleapis.com/css?family=Noto+Serif+SC:300,600|Playfair+Display:400,700,700i|Poppins:400',
    		[],
    		genesis_get_theme_version()
    	);

    Marcy | Amethyst Website Design | Twitter

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble