Font change: Functions.php or header script?

Community Forums Forums Design Tips and Tricks Font change: Functions.php or header script?

This topic is: not resolved

This topic contains 4 replies, has 4 voices, and was last updated by  creativeroute 4 months, 4 weeks ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #92049

    Ron Jones
    Member
    Post count: 5

    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,

    #92069

    braddalton
    Participant
    Post count: 10562

    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.

    [php]
    //* 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 );

    }
    [/php]


    #92080

    Ron Jones
    Member
    Post count: 5

    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?

    #105911

    AlisonM
    Member
    Post count: 1

    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.

    #111698

    creativeroute
    Member
    Post count: 1

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

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.