Custom font change - by preynen876 - on WordPress WooCommerce support

This topic has 4 replies, 3 voices, and was last updated 7 years, 6 months ago ago by Rose Tyler

  • Avatar: preynen876
    preynen876
    Participant
    May 31, 2017 at 13:35

    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”;
    }

    Please, contact administrator
    for this information.
    3 Answers
    Avatar: maxmullins
    Max Mullins
    Participant
    May 31, 2017 at 14:30

    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

    Avatar: preynen876
    preynen876
    Participant
    May 31, 2017 at 17:48

    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;
    }

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    June 1, 2017 at 09:07

    Hello,

    Try to clear cache and check your site http://prntscr.com/fek596

    Regards,
    Rose Tyler.

  • Viewing 4 results - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.Log in/Sign up

8theme customization service
We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.