- This topic has 5 replies, 3 voices, and was last updated 4 years, 8 months ago by
Elvin.
-
AuthorPosts
-
July 14, 2021 at 6:08 am #1855358
Shaun
Hi
Following the steps on I have installed 4 weights of Nunito Sans. I downloaded the fonts from Google and uploaded them via FTP.I then added the following CSS:
/* nunito-sans-300 - latin */ @font-face { font-family: 'Nunito Sans'; font-style: normal; font-weight: 300; src: local(''), url('https://starter.websmall.net/public_html/wp-content/themes/starter-theme/fonts/nunito-sans-v6-latin-300.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */ url('https://starter.websmall.net/public_html/wp-content/themes/starter-theme/fonts/nunito-sans-v6-latin-300.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ } /* nunito-sans-600 - latin */ @font-face { font-family: 'Nunito Sans'; font-style: normal; font-weight: 600; src: local(''), url('https://starter.websmall.net/public_html/wp-content/themes/starter-theme/fonts/nunito-sans-v6-latin-600.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */ url('https://starter.websmall.net/public_html/wp-content/themes/starter-theme/fonts/nunito-sans-v6-latin-600.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ } /* nunito-sans-700 - latin */ @font-face { font-family: 'Nunito Sans'; font-style: normal; font-weight: 700; src: local(''), url('https://starter.websmall.net/public_html/wp-content/themes/starter-theme/fonts/nunito-sans-v6-latin-700.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */ url('https://starter.websmall.net/public_html/wp-content/themes/starter-theme/fonts/nunito-sans-v6-latin-700.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ } /* nunito-sans-800 - latin */ @font-face { font-family: 'Nunito Sans'; font-style: normal; font-weight: 800; src: local(''), url('https://starter.websmall.net/public_html/wp-content/themes/starter-theme/fonts/nunito-sans-v6-latin-800.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */ url('https://starter.websmall.net/public_html/wp-content/themes/starter-theme/fonts/nunito-sans-v6-latin-800.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ }Next, I added the following PHP:
add_filter( 'generate_typography_default_fonts', function( $fonts ) { $fonts[] = 'Nunito Sans'; return $fonts; } );In Customiser, the font shows up as the last one in the Systems group. However:
- It shows all the font weights not just the ones I uploaded
- The font that shows in both the previewer and the live site is a serif font, not Nunito Sans
See link in the private area.
Any help would be much appreciated.
Cheers
ShaunIt shows all the weights, not just the ones I uploaded
July 14, 2021 at 7:06 am #1855426David
StaffCustomer SupportHi there,
all of the font URLs in the @font-face are incorrect and are generating 404 errors.
Make sure those URLs point to the exact directory.The font variants list in the current typography module simple show all possible sizes – its not smart enough to know whether they all exist.
July 14, 2021 at 3:43 pm #1856059Shaun
Thanks David
I have changed the urls, removing the public_html. They now download when you put the URL in the address bar.
However, I am still having the same problem.
/* Theme Name: Starter Child Theme Theme URI: https://www.websmall.net/ Description: Starter theme for GeneratePress childthemes Author: Tom Usborne Author URI: https://tomusborne.com Template: generatepress Version: 0.1 */ /* nunito-sans-300 - latin */ @font-face { font-family: 'Nunito Sans'; font-style: normal; font-weight: 300; src: local(''), url('https://starter.websmall.net/wp-content/themes/starter-theme/fonts/nunito-sans-v6-latin-300.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */ url('https://starter.websmall.net/wp-content/themes/starter-theme/fonts/nunito-sans-v6-latin-300.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ } /* nunito-sans-600 - latin */ @font-face { font-family: 'Nunito Sans'; font-style: normal; font-weight: 600; src: local(''), url('https://starter.websmall.net/wp-content/themes/starter-theme/fonts/nunito-sans-v6-latin-600.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */ url('https://starter.websmall.net/wp-content/themes/starter-theme/fonts/nunito-sans-v6-latin-600.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ } /* nunito-sans-700 - latin */ @font-face { font-family: 'Nunito Sans'; font-style: normal; font-weight: 700; src: local(''), url('https://starter.websmall.net/wp-content/themes/starter-theme/fonts/nunito-sans-v6-latin-700.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */ url('https://starter.websmall.net/wp-content/themes/starter-theme/fonts/nunito-sans-v6-latin-700.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ } /* nunito-sans-800 - latin */ @font-face { font-family: 'Nunito Sans'; font-style: normal; font-weight: 800; src: local(''), url('https://starter.websmall.net/wp-content/themes/starter-theme/fonts/nunito-sans-v6-latin-800.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */ url('https://starter.websmall.net/wp-content/themes/starter-theme/fonts/nunito-sans-v6-latin-800.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */ }add_filter( 'generate_typography_default_fonts', function( $fonts ) { $fonts[] = 'Nunito Sans'; return $fonts; } );July 14, 2021 at 7:40 pm #1856164Elvin
StaffCustomer SupportHi Shaun,
I see your site seems to be using a plugin for its optimization. Can you try clearing its cache or disabling it completely and check if it finally works? Makes sure to clear browser cache as well.
I see the request being made here – https://share.getcloudapp.com/12u481mN – and the site’s heading looks like it’s actually using it.
July 16, 2021 at 12:55 am #1857670Shaun
Thx Elvin
Worked perfectly!July 18, 2021 at 9:56 pm #1860493Elvin
StaffCustomer SupportNo problem. 😀
-
AuthorPosts
- You must be logged in to reply to this topic.