WordPress.org

Ready to get started?Download WordPress

Forums

(child theme 2012) Changing to Google Webfont font/size/color (9 posts)

  1. sonoblondie
    Member
    Posted 1 year ago #

    (Child-Theme 2012)

    I am trying to change the font on my site. I am trying to use "the girl next door" google webfont. Ideally, I would like to have my main color text available in two sizes 16px & 20px then I would like a 18px in yellow and a 18px in red.

    I have very limited css knowledge. I have already attempted to create a rule through the editor. that didn't work. So, I'm wondering if I should copy the css file from my parent theme into my child theme css file?

    I am familiar with Firebug.

  2. So, I'm wondering if I should copy the css file from my parent theme into my child theme css file?

    You don't need to do this. Your child theme should only contain the css that you want modified.

    The way this works is that the stylesheets get read from top to bottom and starts with the parent. So whatever you have written in your child theme will override the parent.

    If you look at the 2012 functions.php file, they've provided instructions on what to do to override the google fonts.

  3. sonoblondie
    Member
    Posted 1 year ago #

    I look where you suggested, is this the correct part:

    The use of Open Sans by default is localized. For languages that use
    * characters not supported by the font, the font can be disabled.
    *
    * To disable in a child theme, use wp_dequeue_style()
    * function mytheme_dequeue_fonts() {
    * wp_dequeue_style( 'twentytwelve-fonts' );
    * }
    * add_action( 'wp_enqueue_scripts', 'mytheme_dequeue_fonts', 11 );
    */

  4. That's right, so in your child theme you could just use:

    function mytheme_dequeue_fonts() {
    wp_dequeue_style( 'twentytwelve-fonts' );
    }
    add_action( 'wp_enqueue_scripts', 'mytheme_dequeue_fonts', 11 );

    and then enqueue your own.

  5. specialmachine
    Member
    Posted 1 year ago #

    Sorry to seem so daft, but then how would one elegantly enqueue their own Google font? I'm just not great with PHP. :)

  6. specialmachine
    Member
    Posted 1 year ago #

    In actual fact I would like to use two Google fonts.

    Abel
    normal 400
    http://www.google.com/webfonts#UsePlace:use/Collection:Abel

    Old Standard
    normal & italic
    http://www.google.com/webfonts#UsePlace:use/Collection:Old+Standard+TT

  7. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

  8. specialmachine
    Member
    Posted 1 year ago #

    Gaahhh. I did that and some helpful person sent me here and closed my topic!

    http://wordpress.org/support/topic/enqueue-a-new-google-font-twentytwelve?replies=2

  9. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    Oh so sorry - that was my mistake -- I did not notice that this was not your thread. I fixed other one for you.

Topic Closed

This topic has been closed to new replies.

About this Topic