Add Custom fonts

Hello,

I have been trying to add custom font, however I don’t seem able to get it to work and need your help.

First I added all the web font files in /wp-content/themes/pro-child/fonts/BebasNeue/

Then edited and added the following in the style.css file (/public_html/wp-content/themes/pro-child/style.css)

@font-face {

font-family: 'Bebas Neue';
src:    url('http://lebanesecorner.pt/wp-content/themes/pro-child/fonts/BebasNeue/BebasNeue-Regular.eot');
src:    url('http://lebanesecorner.pt/wp-content/themes/pro-child/fonts/BebasNeue/BebasNeue-Regular.eot?#iefix') format('embedded-opentype'),
        url('http://lebanesecorner.pt/wp-content/themes/pro-child/fonts/BebasNeue/BebasNeue-Regular.woff2') format('woff2'),
        url('http://lebanesecorner.pt/wp-content/themes/pro-child/fonts/BebasNeue/BebasNeue-Regular.woff') format('woff'),
        url('http://lebanesecorner.pt/wp-content/themes/pro-child/fonts/BebasNeue/BebasNeue-Regular.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}



@font-face {

font-family: 'Bebas Neue';
src:    url('http://lebanesecorner.pt/wp-content/themes/pro-child/fonts/BebasNeue/BebasNeue.eot');
src:    url('http://lebanesecorner.pt/wp-content/themes/pro-child/fonts/BebasNeue/BebasNeue.eot?#iefix') format('embedded-opentype'),
        url('http://lebanesecorner.pt/wp-content/themes/pro-child/fonts/BebasNeue/BebasNeue.woff2') format('woff2'),
        url('http://lebanesecorner.pt/wp-content/themes/pro-child/fonts/BebasNeue/BebasNeue.woff') format('woff'),
        url('http://lebanesecorner.pt/wp-content/themes/pro-child/fonts/BebasNeue/BebasNeue.ttf') format('truetype');
font-weight: normal;
font-style: normal;}

Finally, I used the following CSS to customize the font:
font-family: "Bebas Neue" !important;

Could you please advice if I did something wrong and why it’s not working?

Note that I had some pages setup before switching to the pro child theme and when adding the font files, I did so in the pro-child theme sub folders.

Looking forward to your response.

Thanks!

Hi there,

The most recent version of X and Pro already support importing of custom fonts so you do not need to manually write the custom code.

Please check the screenshot below where to find it:

Hope this helps.

Hi Jade,

Thanks a lot!

So many great new features that it’s hard to keep up with. hh

Regards

You’re most welcome!

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