WordPress.org

Ready to get started?Download WordPress

Forums

Path
Google fonts? (12 posts)

  1. haije
    Member
    Posted 1 year ago #

    What would be the best way to use Google Fonts in the Path theme (child)?

    Thanks :).

  2. Sami Keijonen
    Member
    Theme Author

    Posted 1 year ago #

    In the same way as in parent theme. Look theme functions.php for example.

    Use wp_enqueue_scripts in setup function and wp_enqueue_style-function.

  3. haije
    Member
    Posted 1 year ago #

    Thanks a lot!

  4. Jaaaarne
    Member
    Posted 1 year ago #

    Umm... Is there an easy way to replace the Oswald font with something else? I want to replace it with something that will work with my language, and Oswald doesn't.

  5. Sami Keijonen
    Member
    Theme Author

    Posted 1 year ago #

    Put this in your child theme style.css.

    h1, h2, h3, h4, h5, h6 {
    	font-family: Georgia,sans-serif;
    }

    You can set font-family like that.

    P.S. What is the language, which Oswald doesn't support?

  6. Jaaaarne
    Member
    Posted 1 year ago #

    All languages that use Cyrillic alphabet. Or, well, everything that is not Latin script, for that matter. :)

    Dropping Google fonts from the .css is easy, I wouldn't even be asking. :) What I'd like to do, however, is replace Oswald with something from Google fonts that actually does support Cyrillic.

    Any ideas?

  7. andrewmills
    Member
    Posted 1 year ago #

    How about Cuprum? or perhaps Ubuntu Condensed?

  8. Sami Keijonen
    Member
    Theme Author

    Posted 1 year ago #

    replace Oswald?

    You can do the same in your child theme functions.php as in Path theme functions.php. Look for wp_enqueue_script-hook. Here is premade child theme if needed.

    http://themehybrid.com/themes/path-child

  9. Jaaaarne
    Member
    Posted 1 year ago #

    I'm sorry, Sami, but I'm just not good enough with php to even understand what you're suggesting. I can work with css alright, I can work with html, but my understanding of php is almost nonexistent and I always need to see html behind it in order to mess around with it. Here I just don't understand what to do. :) What exactly should I add where in order to override the non-cyr webfont of the parent theme?

    As for the fonts, Andrew, the ones you list will do. But in order for them to work they must contain the Cyrillic subset. Otherwise they too won't work.

  10. Sami Keijonen
    Member
    Theme Author

    Posted 1 year ago #

    Like this in child theme functions.php inside setup function.

    /* Enqueue Google fonts */
    	add_action( 'wp_enqueue_scripts', 'path_child_google_fonts' );

    And this outside setup function.

    function path_child_google_fonts() {
    
    	wp_enqueue_style( 'font-oswald', 'http://fonts.googleapis.com/css?family=Oswald:400,300,700', false, 1.0, 'screen' );
    
    }
  11. andrewmills
    Member
    Posted 1 year ago #

    >> As for the fonts, Andrew, the ones you list will do. But in order for them to work they must contain the Cyrillic subset. Otherwise they too won't work.

    According to Google Web Fonts filtering tool, Cuprum supports Cyrillic, and Ubuntu Condensed supports both Cyrillic and Cyrillic Extended. I also tried to match the thickness, slant and width of my choice with the Oswald font.

  12. Jaaaarne
    Member
    Posted 1 year ago #

    Thank you, Sami! It works! :)

    Yes, Andrew, Cuprum and Ubuntu Condensed support Cyrillic. However, for them to be useful they should include the Cyrillic subset when called: http://fonts.googleapis.com/css?family=Cuprum&subset=cyrillic Otherwise it won't work, because Google will only load the Latin subset by default, even though the font family does have Cyrillic subset.

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic

Tags

No tags yet.