Custom fonts with multiple font-weights not working
-
Hi,
I have added a custom font with multiple weights. Unfortunately one of them, the Regular, does not load. I can see it in the customizer and can select it but it does not load on the front end.
Here’s my CSS:
@font-face {
font-family: ‘Calibre Regular’;
src: url(‘https://staging.parcelpet.com/wp-content/uploads/2019/11/CalibreWeb-Regular.eot’); /* IE9 Compat Modes */
src: url(‘https://staging.parcelpet.com/wp-content/uploads/2019/11/CalibreWeb-Regular.woff2’) format(‘woff2’), /* Super Modern Browsers */
url(‘https://staging.parcelpet.com/wp-content/uploads/2019/11/CalibreWeb-Regular.woff’) format(‘woff’), /* Modern Browsers */
font-weight: 400;}
@font-face {font-family: ‘Calibre Semibold’;
src: url(‘https://staging.parcelpet.com/wp-content/themes/oceanwp-child-theme/fonts/CalibreWeb-Semibold.woff2’); /* IE9 Compat Modes */
src: url(‘https://staging.parcelpet.com/wp-content/themes/oceanwp-child-theme/fonts/CalibreWeb-Semibold.woff2’) format(‘woff2’), /* Super Modern Browsers */
url(‘https://staging.parcelpet.com/wp-content/themes/oceanwp-child-theme/fonts/CalibreWeb-Semibold.woff’) format(‘woff’), /* Modern Browsers */
font-weight: 600;
}Here’s my php in the functions.php:
function ocean_add_custom_fonts() {
return array( ‘Calibre Regular’, ‘Calibre Semibold’ ); // You can add more then 1 font to the array!
}Only the SemiBold works.
Any idea what should I do to make it work?
I have selected the regular for the body text but it does not work.
- The topic ‘Custom fonts with multiple font-weights not working’ is closed to new replies.