Home Forums WoodMart support forum Remove woodmart font

Remove woodmart font

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #148627

    Stanley Black
    Participant

    Hello,

    How to remove woodmart font(woodmart/fonts/woodmart-font.woff)?

    I don’t use your icons and this font just make me problems in gtmetrix and google insights.

    Kind regards

    #148724

    Hello,

    Please find this file: woodmart/inc/classes/Dynamiccss.php

    Next, find this functions:

    public function icons_font_css() {
            $output = '';
            $font_display = woodmart_get_opt( 'icons_font_display' );
            // Our font.
            $output .= '@font-face {
                font-weight: normal;
                font-style: normal;
                font-family: "woodmart-font";
                src: url("' . WOODMART_THEME_DIR . '/fonts/woodmart-font.eot");
                src: url("' . WOODMART_THEME_DIR . '/fonts/woodmart-font.eot?#iefix") format("embedded-opentype"),
                url("' . WOODMART_THEME_DIR . '/fonts/woodmart-font.woff") format("woff"),
                url("' . WOODMART_THEME_DIR . '/fonts/woodmart-font.woff2") format("woff2"),
                url("' . WOODMART_THEME_DIR . '/fonts/woodmart-font.ttf") format("truetype"),
                url("' . WOODMART_THEME_DIR . '/fonts/woodmart-font.svg#woodmart-font") format("svg");';
            
            if ( 'disable' !== $font_display ) {
                $output .= 'font-display:' . $font_display . ';';
            }
            $output .= '}';
            
            if ( ! woodmart_get_opt( 'disable_font_awesome_theme_css' ) ) {
                $prefix = '';
                if ( woodmart_get_opt( 'light_font_awesome_version' ) ) {
                    $prefix = '-light';
                }
                // FontAwesome
                $output .= '@font-face {
                    font-family: "FontAwesome";
                    src: url("' . WOODMART_THEME_DIR . '/fonts/fontawesome-webfont' . $prefix . '.eot?v=4.7.0");
                    src: url("' . WOODMART_THEME_DIR . '/fonts/fontawesome-webfont' . $prefix . '.eot?#iefix&v=4.7.0") format("embedded-opentype"),
                    url("' . WOODMART_THEME_DIR . '/fonts/fontawesome-webfont' . $prefix . '.woff2?v=4.7.0") format("woff2"),
                    url("' . WOODMART_THEME_DIR . '/fonts/fontawesome-webfont' . $prefix . '.woff?v=4.7.0") format("woff"),
                    url("' . WOODMART_THEME_DIR . '/fonts/fontawesome-webfont' . $prefix . '.ttf?v=4.7.0") format("truetype"),
                    url("' . WOODMART_THEME_DIR . '/fonts/fontawesome-webfont' . $prefix . '.svg?v=4.7.0#fontawesomeregular") format("svg");
                    font-weight: normal;
                    font-style: normal;';
        
                if ( 'disable' !== $font_display ) {
                    $output .= 'font-display:' . $font_display . ';';
                }
        
                $output .= '}';
            }
            return $output;
        }

    Replace it with this function:

    public function icons_font_css() {
            $output = '';
            $font_display = woodmart_get_opt( 'icons_font_display' );
            if ( ! woodmart_get_opt( 'disable_font_awesome_theme_css' ) ) {
                $prefix = '';
                if ( woodmart_get_opt( 'light_font_awesome_version' ) ) {
                    $prefix = '-light';
                }
                // FontAwesome
                $output .= '@font-face {
                    font-family: "FontAwesome";
                    src: url("' . WOODMART_THEME_DIR . '/fonts/fontawesome-webfont' . $prefix . '.eot?v=4.7.0");
                    src: url("' . WOODMART_THEME_DIR . '/fonts/fontawesome-webfont' . $prefix . '.eot?#iefix&v=4.7.0") format("embedded-opentype"),
                    url("' . WOODMART_THEME_DIR . '/fonts/fontawesome-webfont' . $prefix . '.woff2?v=4.7.0") format("woff2"),
                    url("' . WOODMART_THEME_DIR . '/fonts/fontawesome-webfont' . $prefix . '.woff?v=4.7.0") format("woff"),
                    url("' . WOODMART_THEME_DIR . '/fonts/fontawesome-webfont' . $prefix . '.ttf?v=4.7.0") format("truetype"),
                    url("' . WOODMART_THEME_DIR . '/fonts/fontawesome-webfont' . $prefix . '.svg?v=4.7.0#fontawesomeregular") format("svg");
                    font-weight: normal;
                    font-style: normal;';
        
                if ( 'disable' !== $font_display ) {
                    $output .= 'font-display:' . $font_display . ';';
                }
        
                $output .= '}';
            }
            return $output;
        }

    Best Regards

    #155687

    James
    Participant

    Is this solution still valid?

    I can’t find the file woodmart/inc/classes/Dynamiccss.php anymore in the directory mentioned.

    #155717

    Eric Watson
    Participant

    Hello,

    Now this code is in the file woodmart/inc/classes/Themesettingscss.php function get_icons_font_css()

    Kind Regards
    XTemos Studio

    #156781

    James
    Participant

    Should I still use the above function you mentioned to replace with?

    Asking cause I see the current function is Themesettingscss.php has slightly changed,
    thanks

    #156858

    Eric Watson
    Participant

    Hello,

    You can use this function

    public function get_icons_font_css() {
    		$output = '';
    		$url    = woodmart_remove_https( WOODMART_THEME_DIR );
    
    		$font_display = woodmart_get_opt( 'icons_font_display' );
    
    		if ( ! woodmart_get_opt( 'disable_font_awesome_theme_css' ) ) {
    			$prefix = '';
    			if ( woodmart_get_opt( 'light_font_awesome_version' ) ) {
    				$prefix = '-light';
    			}
    
    			// FontAwesome
    			$output .= '@font-face {
    				font-family: "FontAwesome";
    				src: url("' . $url . '/fonts/fontawesome-webfont' . $prefix . '.eot?v=4.7.0");
    				src: url("' . $url . '/fonts/fontawesome-webfont' . $prefix . '.eot?#iefix&v=4.7.0") format("embedded-opentype"),
    				url("' . $url . '/fonts/fontawesome-webfont' . $prefix . '.woff2?v=4.7.0") format("woff2"),
    				url("' . $url . '/fonts/fontawesome-webfont' . $prefix . '.woff?v=4.7.0") format("woff"),
    				url("' . $url . '/fonts/fontawesome-webfont' . $prefix . '.ttf?v=4.7.0") format("truetype"),
    				url("' . $url . '/fonts/fontawesome-webfont' . $prefix . '.svg?v=4.7.0#fontawesomeregular") format("svg");
    				font-weight: normal;
    				font-style: normal;';
    
    			if ( 'disable' !== $font_display ) {
    				$output .= 'font-display:' . $font_display . ';';
    			}
    
    			$output .= '}';
    		}
    
    		return $output;
    	}

    Kind Regards
    XTemos Studio

Viewing 6 posts - 1 through 6 (of 6 total)