• 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

Font change: Functions.php or header script?

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 › Font change: Functions.php or header script?

This topic is: not resolved

Tagged: functions.php, google fonts, theme

  • This topic has 4 replies, 4 voices, and was last updated 7 years, 11 months ago by creativeroute.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • February 23, 2014 at 3:39 pm #92049
    Ron Jones
    Member

    I want to use a particular pair of Google Fonts in one of the Studio Press themes. A few days ago, I saw here a snippet of code for changing the default font by using functions .php.

    Would there be any advantage to using functions.php to make that change...

    .... or would it be better to use the Theme Settings > Header scripts box?

    Thanks,

    February 23, 2014 at 8:25 pm #92069
    Brad Dalton
    Participant

    If you theme already includes this code in your child themes functions file, simply modify it with the names for your new font or add to it with the new font which would be safer but less efficient of not using the old fonts.

    //* Enqueue Google fonts
    add_action( 'wp_enqueue_scripts', 'executive_google_fonts' );
    function executive_google_fonts() {
    
    	wp_enqueue_style( 'google-font', '//fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700', array(), CHILD_THEME_VERSION );
    
    }
    

    2700 Genesis Tutorials

    February 23, 2014 at 9:13 pm #92080
    Ron Jones
    Member

    Thanks Brad! I've got my google fonts all queued up.

    But... what happens when the child theme (in this particular case, it's Executive Pro) is updated...won't I lose my settings?

    May 19, 2014 at 2:39 pm #105911
    AlisonM
    Member

    I think you will lose your settings. I have watched a video on You Tube about this topic. She suggests creating a custom css style sheet for this very reason.

    June 26, 2014 at 9:53 pm #111698
    creativeroute
    Member

    Thanks for posting the video Alison. She is very thorough.

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