• 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

Load Google font funktions.php

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 › Load Google font funktions.php

This topic is: resolved

Tagged: Google font

  • This topic has 1 reply, 2 voices, and was last updated 1 year, 10 months ago by vukmilicevic.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • August 11, 2020 at 12:30 am #500530
    mollebjerg
    Participant

    I would like to change my fonts from Poppins to Roboto and Roboto Slab. How can I do that?

    My theme (Revolution Pro) loads the current font family (Poppens) in funktions.php

    function revolution_enqueue_scripts_styles() {
    wp_enqueue_style(
    genesis_get_theme_handle() . '-fonts',
    '//fonts.googleapis.com/css?family=Poppins:400,200&display=optional',
    [],
    genesis_get_theme_version()
    );

    I have tried to change the URL to href="https://fonts.googleapis.com/css2?family=Roboto&family=Roboto+Slab&display=swap" but it does not work.

    https://babyuniverset.dk/
    August 12, 2020 at 6:05 pm #500544
    vukmilicevic
    Participant

    Hello,

    Change "Poppins" to "Roboto" or "Roboto+Slab" and ditch the "200". Much more useful is 400,700 (which translates to normal and bold). Also, instead of display=optional, you should (as per Google's advice) use "display=swap".

    By not using &display=swap, you will not have the issue with changing fonts (the short blink on the first load, however it will take an increased amount of time before any text using the font is visible on your website, and PageSpeedInsights will mark it as an error. Aggregation of such "errors" over time affects your SERP.

    And, finally, you can combine fonts, just separate them with a pipe symbol:

    //fonts.googleapis.com/css?family=Playfair+Display|Source+Serif+Pro|Suwannaphum&display=swap

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 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

© 2022 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