WordPress.org

Ready to get started?Download WordPress

Forums

Bushwick
[resolved] Removing the Font Stylesheet? (11 posts)

  1. Steven Jay Cohen
    Member
    Posted 10 months ago #

    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 );
  2. Kathryn
    Automattic Happiness Engineer
    Posted 10 months ago #

    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.

  3. Steven Jay Cohen
    Member
    Posted 10 months ago #

    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...

  4. Kathryn
    Automattic Happiness Engineer
    Posted 10 months ago #

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

  5. Steven Jay Cohen
    Member
    Posted 10 months ago #

    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.

  6. Kathryn
    Automattic Happiness Engineer
    Posted 10 months ago #

    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.

  7. Steven Jay Cohen
    Member
    Posted 10 months ago #

    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.

  8. Kathryn
    Automattic Happiness Engineer
    Posted 10 months ago #

    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.

  9. Steven Jay Cohen
    Member
    Posted 10 months ago #

    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.

  10. Kathryn
    Automattic Happiness Engineer
    Posted 10 months ago #

    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.

  11. Steven Jay Cohen
    Member
    Posted 10 months ago #

    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
     */

Reply

You must log in to post.

About this Theme

About this Topic