• Hello,
    I’m currently working on getting a clients PageSpeed score up and have hit a roadblock with the standard Google Font Source Sans Pro which is loaded with Storefront. I’ve created a custom child theme and am loading our preferred font Julius Sans through the header. I’ve tried the dequeue script offered at Github (https://github.com/woocommerce/storefront/issues/845) with no joy. I’ve tried a couple others offered by random devs with no luck. I’ve even tried adding /inc/class-storefront.php to my child theme with the call to Source Sans Pro switched out and it’s still being called. I am banging my head on the desk at this point ?? Anyway, it’s crucial that we remove the call for unused fonts in order to improve performance. If you could let me know which method might actually work, I would really, really appreciate it.

    Best wishes,
    Tabitha

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi @vd11,

    I think I figured out what was going on here. ??

    The action didn’t have a priority. I added one at 100 which should make it fire later than anything else enqueuing the font, and it seems to have worked. My snippet looks like the one below.

    function storefront_remove_google_fonts() {
        wp_dequeue_style( 'storefront-fonts' );
    }
    
    add_action( 'wp_enqueue_scripts', 'storefront_remove_google_fonts', 100);

    BEFORE:
    Before removing Google Fonts
    Link to image: https://cld.wthms.co/FMpsmL

    AFTER:
    After removing Google Fonts
    Link to image: https://cld.wthms.co/MjtLtz

    I hope that helps!

    Thread Starter Vortex11

    (@vd11)

    It took forever to get a chance to test this but it does work perfectly! Thank you so much!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Need to dequeue Storefront fonts – Please help’ is closed to new replies.