Can't get Custom Font to work!

Hey there,

I’ve gone through every step here https://css-tricks.com/snippets/css/using-font-face/ twice and tried different guides but to no prevail!

I am at a loss to how to get this working.

The site I’m working on is www.harvestnutrition.com.au

I uploaded the font files to “public_html/wp-content/themes/pro-child”

I’ve added this to my child themes style.css

@font-face {
font-family: ‘AvenirLTStd-Heavy’;
src:url(’/public_html/wp-content/themes/pro-child/AvenirLTStd-Heavy.eot’); /* IE9 Compat Modes /
src:url(’/public_html/wp-content/themes/pro-child/AvenirLTStd-Heavy.eot?#iefix’) format(‘embedded-opentype’), /
IE6-IE8 /
url(’/public_html/wp-content/themes/pro-child/AvenirLTStd-Heavy.woff’) format(‘woff’), /
Pretty Modern Browsers /
url(’/public_html/wp-content/themes/pro-child/AvenirLTStd-Heavy.ttf’) format(‘truetype’), /
Safari, Android, iOS /
url(’/public_html/wp-content/themes/pro-child/CenturyOldStyleStd-Bold.svg#svgFontName’) format(‘svg’); /
Legacy iOS */
}

@font-face {
font-family: ‘CenturyOldStyleStd-Bold’;
src:url(’/wp-content/themes/pro-child/CenturyOldStyleStd-Bold.eot’); /* IE9 Compat Modes /
src:url(’/wp-content/themes/pro-child/CenturyOldStyleStd-Bold.eot?#iefix’) format(‘embedded-opentype’), /
IE6-IE8 /
url(’/wp-content/themes/pro-child/CenturyOldStyleStd-Bold.woff’) format(‘woff’), /
Pretty Modern Browsers /
url(’/wp-content/themes/pro-child/CenturyOldStyleStd-Bold.ttf’) format(‘truetype’), /
Safari, Android, iOS /
url(’/wp-content/themes/pro-child/CenturyOldStyleStd-Bold.svg#svgFontName’) format(‘svg’); /
Legacy iOS */
}

and have tried to get it to load onto the website using

body {
font-family: “AvenirLTStd-Heavy”, arial, sans-serif !important;

}

h1, h2, h3, h4, h5, h6 {
font-family: ‘CenturyOldStyleStd-Bold’, sans-serif !important;

}

But I can’t get the font to change on the home page!

Any assistance would be greatly appreciated.

Hey @TheIronWarlord,

Please follow this tutorial instead https://youtu.be/2gD4TrV_Kv4

If you could still not get it to work, we would need your WP admin and FTP access. Please post it in a Secure Note.

Thanks.

1 Like

Thank you Christian, I will have a go through it and report back if any issues.

Appreciate the response,

Dan.

Let us know how this goes!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.