• Resolved Steven Jay Cohen

    (@stevenjaycohen)


    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 Presner

    (@zoonini)

    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.

    Thread Starter Steven Jay Cohen

    (@stevenjaycohen)

    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 Presner

    (@zoonini)

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

    Thread Starter Steven Jay Cohen

    (@stevenjaycohen)

    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 Presner

    (@zoonini)

    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.

    Thread Starter Steven Jay Cohen

    (@stevenjaycohen)

    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 Presner

    (@zoonini)

    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.

    Thread Starter Steven Jay Cohen

    (@stevenjaycohen)

    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.

    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.

    Thread Starter Steven Jay Cohen

    (@stevenjaycohen)

    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 ‘Removing the Font Stylesheet?’ is closed to new replies.