• Resolved Alexander Goncharov

    (@luzlol)


    I do feel like making topic for this another issue. =)

    I don’t want to enqueue this google font you are using, mostly because I use typekit and their awesome collection of fonts.

    In your functions.php you suggest to use this snippet:

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

    but how will this work if child theme’s functions.php actually loads before the parent theme, so it simple can’t dequeue style, that’s not enqueued yet =)

    Thanks in advance

Viewing 3 replies - 1 through 3 (of 3 total)
  • ronangelo

    (@ronangelo)

    Change action hook from wp_enqueue_scripts to wp_print_styles

    add_action( 'wp_enqueue_scripts', 'mytheme_dequeue_fonts', 11 );
    add_action( 'wp_print_styles', 'mytheme_dequeue_fonts' );

    Thread Starter Alexander Goncharov

    (@luzlol)

    why not use wp_footer hook to dequeue them?

    lol just kidddin, I was looking for more elegant way to do this, than using later hook =)

    Thanks, anyway!

    Theme Author Kelly Choyce-Dwan

    (@ryelle)

    I double checked, and the code snippet provided worked for me. The mytheme_dequeue_fonts function is enqueued at priority 11, which means it will run after flounder_fonts. So, flounder_fonts runs, and enqueues the font from google, and then your function, mytheme_dequeue_fonts, will run, dequeuing it.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘flounder-fonts’ is closed to new replies.