Home / Forums / You Theme Support / Google fonts handling

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • I need to load different font variants (300/light, 400/regular, 600/semi-bold, 700/bold). Usually I do this manually (wp_enqueue_style) and therefore would like to disable font loading by the theme, because the theme somehow messes up the link to google if you choose different weights for different parts in the skin (headlines, menu, general, …) but use the same weight more than ounce: http://fonts.googleapis.com/css?family=Open+Sans:600,300,300,regular

    From the source code I see you already query an option ( of_get_option(‘webfontloader’) ) to modify the font loading. Beside the fact this option can’t neither be set in the theme options nor within a skin, it wont disable the font loading at all. So the only way to get around this is to set only the regular font in the skin and to load the ‘missing’ weights manually. Which causes a second http request which consumes time. Bad SEO thingy 😉

    There would be two ways to prevent this issue. Either allow selecting more than one weight for the default font or introduce an option or at least a filter to switch font loading of.

    Hi Michael,

    I have forwarded your request to the developer. I will get back to you once I hear from him.

    Regards,

    Andy
    Andy
    Keymaster

    Hi Michael,

    Thanks for the feedback, it’s a tricky one. I believe the best method would be to add an extra option to load extra font weight variants. I’ll also introduce the option to disable the Google font entirely.

    For the time being, you can edit you/functions-core.php and remove this line:

    add_action( 'wp_enqueue_scripts', 'acoda_fonts' );

    I hope that helps?

    I don’t like messing around with core files. So I removed the fonts from the child theme:

    add_action( 'after_setup_theme', 'you_remove_functions' );
    function you_remove_functions() {
    
    	remove_action( 'wp_enqueue_scripts', 'acoda_fonts' );
    
    }

    Hi Michael,

    Just to confirm, is everything working now?

    Regards,

    Yes, as i wrote I already removed the fonts.

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

You must be logged in to reply to this topic.