WordPress.org

Support

Support » Themes and Templates » Bushwick » [Resolved] Removing the Font Stylesheet?

[Resolved] Removing the Font Stylesheet?

  • Is this the proper way to remove the Bushwick font stylesheet?

    function bushwick_remove_styles() {
    	wp_dequeue_style( 'bushwick-font-stylesheet' );
    }
    add_action( 'wp_enqueue_scripts', 'bushwick_remove_styles', 20 );
Viewing 10 replies - 1 through 10 (of 10 total)
  • Moderator Kathryn

    @zoonini

    Automattic Happiness Engineer

    Hi there, try this function from my colleague Frank:

    function bw_child() {
      remove_action( 'wp_enqueue_scripts', 'bushwick_fonts' );
    }
    add_action( 'after_setup_theme', 'bw_child' );

    Let me know how it goes.

    Still seeing this come through:

    font: 700 2.2rem/1.5 "Aleo","Skolar","ff-tisa-web-pro","Georgia",serif;

    Trying to dump references to fonts that I am not using…

    Moderator Kathryn

    @zoonini

    Automattic Happiness Engineer

    Hmm – that just looks like a font declaration in the stylesheet, not a font file being enqueued in the head, right?

    Correct, that is a font definition from Bushwick still showing up within the browser after the function you sent me.

    By the way, that function, did remove the menu widgets, not the fonts.

    Moderator Kathryn

    @zoonini

    Automattic Happiness Engineer

    Correct, that is a font definition from Bushwick still showing up within the browser after the function you sent me.

    The function I sent is to remove the font files from being enqueued in the head section.

    Your CSS itself remains as is, but you can override particular styles in your child theme’s stylesheet.

    It seems that by trying to remove the fonts, I also remove the “font” that provides the menu widgets. I don’t want to do that. So, let’s call this one closed.

    Moderator Kathryn

    @zoonini

    Automattic Happiness Engineer

    OK. 🙂 I’m not actually sure which menu widgets you’re referring to, but if you need further help feel free to post again with a screenshot so I can take a look.

    One of the fonts removed by the code was a non-textual widget/icon font. So, the code you provided leaves a blank square where the mobile menu toggle and the downward and right-facing arrows used in the navigation menus used to be.

    If there were a way to remove the references to the textual fonts but leave this “graphic” font intact, that would be very useful.

    Moderator Kathryn

    @zoonini

    Automattic Happiness Engineer

    Thanks for the info. That sounds like the Genericons font. I think the function can only remove all the fonts, since the three fonts (Aleo, Lato, Genericons) are enqueued together in the parent theme.

    You could try experimenting adding back Genericons using an additional function.

    From Bushwick’s own functions.php (line #107):

    /**
     * Loads our special font CSS file.
     *
     * To disable in a child theme, use wp_dequeue_style()
     * function mytheme_dequeue_fonts() {
     *     wp_dequeue_style( 'bushwick-fonts' );
     * }
     * add_action( 'wp_enqueue_scripts', 'mytheme_dequeue_fonts', 11 );
     *
     * @return void
     */
Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘[Resolved] Removing the Font Stylesheet?’ is closed to new replies.
Skip to toolbar