This topic has 4 replies, 3 voices, and was last updated 7 years, 6 months ago ago by Rose Tyler
Hello,
For my website i would like to use a custom font all H captions. I am using the following code, but this does not work:
@font-face {
font-family: ‘RelayComp-Black’;
url(‘css/fonts/RelayComp-Black.ttf’) format(‘truetype’);
font-weight: normal;
font-style: normal;
}
h1,h2,h3,h4,h5,h6{
font-family:”RelayComp-Black”;
}
Hello @preynen876
Please read this article about how to add custom fonts:
https://www.w3schools.com/cssref/css3_pr_font-face_rule.asp
Check the path to the source path to the file where it should be added.
You may also add fonts into the Child theme functions.php like following:
Add following code in functions.php after the header lines:
function google_webfonts() {
wp_enqueue_style( ‘google-webfonts’, ‘directpathtoyourfont’ );
}
add_action(‘init’, ‘wp_enqueue_scripts’, ‘directpathtoyourfont’ );
Regards,
Max Mullins
As you can see in the post above i have tried that. Also adding the following to style.css or custom.css does not work:
@font-face {
font-family: RelayComp;
src: url(css/fonts/RelayComp-Black.ttf);
}
h1,h2,h3,h4,h5,h6{
font-family: RelayComp;
}
You must be logged in to reply to this topic.Log in/Sign up