• 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

Removing @import for Google Fonts?

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 › General Discussion › Removing @import for Google Fonts?

This topic is: not resolved

Tagged: enqueue styles, import

  • This topic has 3 replies, 2 voices, and was last updated 5 years, 1 month ago by Victor Font.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • July 3, 2017 at 2:17 pm #208622
    cneuman
    Participant

    Hi,

    I just removed the @import url(https://fonts.googleapis.com/css?family=PT+Sans);
    from my site as I read this method is no longer considered optimum. So I added the line of code below to the Enqueue Scripts sectiion in my Functions.php. Seems to work ok. I want to understand why it works? Does the line of code contain all the necessary instructions to pull the fonts?
    I am using the original "Agency" theme although it has been modified quite a bit. So these newer functions may not be defined. That is my concern. Probably need a good tutorial on how this works!

    wp_enqueue_style( 'google-font', '//fonts.googleapis.com/css?family=PT+Sans', array(), CHILD_THEME_VERSION );

    http://www.sweetwaternutrition.com
    July 3, 2017 at 2:32 pm #208623
    Victor Font
    Moderator

    What you've done is the exact way all Google fonts are loaded in the newer Studio Press themes. Functions that begin with wp_ are WordPress core functions. Details and explanations about them can be found in the WordPress codex and/or on the developer.wordpress.org. Functions that begin with genesis_ are Genesis Framework core.


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    July 3, 2017 at 2:36 pm #208624
    cneuman
    Participant

    Hi Victor,

    So I think I understand that it calls the function from the WordPress Core. I was wondering why it worked and where the function was defined. So that's it.

    Thanks for explaining!

    July 3, 2017 at 4:35 pm #208633
    Victor Font
    Moderator

    Just Google the function. This has nothing to do with Genesis.

    https://developer.wordpress.org/reference/functions/wp_enqueue_style/


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘General Discussion’ 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