• Resolved lukefive

    (@lukefive)


    We put Google’s Raleway and Open Sans fonts in a directory on our server. I want to redirect the theme’s font calls to this local directory. But what is most efficient with One Press?
    (I can handle PHP)

Viewing 5 replies - 1 through 5 (of 5 total)
  • Theme Author FameThemes

    (@famethemes)

    Hello @lukefive,

    I recommend you do the following here:

    https://www.ostraining.com/blog/wordpress/custom-fonts/

    Thread Starter lukefive

    (@lukefive)

    Based on that link I am using the following but still pulling in Google online fonts…

    @font-face {
        font-family: 'Raleway';
        src: url('../../../assets/fonts/raleway-v11-latin-700.eot');
        src: url('../../../assets/fonts/raleway-v11-latin-700.eot?#iefix') format('embedded-opentype'),
             url('../../../assets/fonts/raleway-v11-latin-700.woff') format('woff'),
             url('../../../assets/fonts/raleway-v11-latin-700.woff2') format('woff2'),
             url('../../../assets/fonts/raleway-v11-latin-700.ttf') format('truetype'),
             url('../../../assets/fonts/raleway-v11-latin-700.svg#Raleway’) format('svg');
        font-weight: normal;
        font-style: normal;
         }
    
    Theme Author FameThemes

    (@famethemes)

    Your font url should be:
    http(s)://(www)your-site.com/wp-content/themes/onepress/assets/fonts/raleway-v11-latin-700.eot

    then you need to set font for whole page:
    body , p { font-family: 'font-name'; }

    Let me know!

    Thread Starter lukefive

    (@lukefive)

    The “assets” folder is at the same level as wp-content. We have several sites on this server, and I wanted the “fonts” folder that is inside “assets” to be available to all sites.

    One the other hand, I plan to test using an absolute URL to see what happens.

    Thread Starter lukefive

    (@lukefive)

    I finally removed part of the CSS that tried to call the SVG version. Seemed to be interfering with other CSS. And, not really necessary for good browser support.

    url('https://example.com/assets/fonts/raleway-v11-latin-800.svg#Raleway’) format('svg');

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How change font url to local files?’ is closed to new replies.