October 13, 2016 at 11:02 pm #698918
Can you advise me on something please?
I would like to gain a small advantage by using my CDN (KeyCDN) to serve Google Fonts instead of calling the Google API (fonts.gstatic.com). This may have marginal speed advantages when I switch to HTTPS as I can enable HTTP/2 to make one less DNS call. As I already serve from my CDN it makes sense to serve the fonts from there too.
Apparently once placed in a root directory (done and with the correct cdn zonealias URL) I need to make a CSS to point to the CDN to serve the fonts. Fine, I have that CSS in two notepad files ready to go.
But, and here’s the question (eventually), can you advise me where to place the style-sheet within the theme? If I call it ‘fonts’ (or similar) then I must have to tell the theme where to call this from right? This is where I get a bit stuck so please bear with me.
This is from your forums on turning off Google fonts within the theme https://kriesi.at/support/topic/remove-google-web-font/ – is that the right thing to do? I just don’t know where to put the new CSS file and then how to point the theme to tell it where to pull the fonts from.
This has the information I have been following: https://www.keycdn.com/blog/google-fonts-cdn/
Hope you can help?
October 14, 2016 at 4:43 am #698959
- This topic was modified 3 years, 3 months ago by Swarez.
I am asking the same question
If I want to use ‘Open Sans’ but want to serve the font from my server via a CDN.
I add the CSS to the additional CSS section in the theme
If I choose not to use the font in the theme setting that will not work.
So how do I tell the theme to use ‘Open Sans’ but not to load the call to pull the API FontOctober 18, 2016 at 8:48 pm #700849
AndyOctober 22, 2016 at 5:14 pm #702836
Not the solution really?
Are you saying that the only way to do this is to modify every reference to the font locations in every style sheet file with your relevant CDN location?
EdOctober 25, 2016 at 7:33 am #703618
From the article:
3.) Update CSS
Then copy the CSS from the tool and put it into a separate stylesheet on your website or you can use a free plugin like Simple Custom CSS and JS to add custom CSS to your header or footer. Then simply update the source URLs so that they are pointed at your CDN.
Did you try the plugin? https://wordpress.org/plugins/custom-css-js/
And yes, you can use the code from the previous thread to disable the default google font link.
You must be logged in to reply to this topic.