Best wordpress security & maintenance

If you don’t want to get fonts from the other sites you can host them locally on yours WordPress installation. In order to achieve that you need to follow just this simple steps described below.

Find font that you like the most. In most cases the fonts are in ,ttf format. To be able to use fonts online they need to be in the .woff2, .woff or .svg format (svg files are for the apple devices) .

You need to convert that ttf file on the online font converter  Font Squirrel or any other.  Download files to your computer.

In the child theme create folder named fonts and in that folder upload all your fonts .woff2, .woff and .svg.

After that in your css file in the child theme add the flowing code:

@font-face {
    font-family: 'YOUR FONT FAMILY';
    src: url('wp-content/themes/YOUR-CHILD-THEME-FOLDER/fonts/NAME-OF-THE-FONT.woff2') format('woff2'),
         url('wp-content/themes/YOUR-CHILD-THEME-FOLDER/fonts/NAME-OF-THE-FONT.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

YOUR FONT FAMILY change with the yours font family, YOUR-CHILD-THEME-FOLDER change with the child theme folder name and finally NAME-OF-THE-FONT change with the font file name that you uploaded to the child theme folder.

 

You can add as many fonts as you like with this method.

Pin It on Pinterest

Share This