• Resolved danina84

    (@danina84)


    Hi,
    is it possible to add fonts via @font-face? I tried it but it didn’t work…

Viewing 10 replies - 1 through 10 (of 10 total)
  • hannah

    (@hannahritner)

    Hey,
    What excactly isn’t working? Have a read here- http://www.w3schools.com/cssref/css3_pr_font-face_rule.asp

    Hannah

    Thread Starter danina84

    (@danina84)

    Hi,
    thanks, I have already read through various tutorials. I think I am not adding the url right. Could you help me with that?

    Let’s say my site is called http://www.mysite.com
    What exactly would the css be? This:

    @font-face {
    font-family: ‘fontname’;

    src: url(‘html/mysite.com/wordpress/wp-content/themes/theme_child/fonts/fontname-webfont.woff’) format(‘woff’);
    font-weight: normal;
    font-style: normal;
    }
    And then I added
    p{
    font-family: ‘fontname’;
    }

    did not work…

    stephencottontail

    (@stephencottontail)

    You’ve got a syntax error:

    src: url(‘html/mysite.com/wordpress/wp-content/themes/theme_child/fonts/fontname-webfont.woff’) format(‘woff’);

    should be this:

    src: url(‘http://mysite.com/wordpress/wp-content/themes/theme_child/fonts/fontname-webfont.woff’) format(‘woff’);

    Can you post a link to your site?

    Thread Starter danina84

    (@danina84)

    I tried that also, didn’t work other than that the p font is now shown as Arial(standard font).
    I also tried font-family:”fontname”; instead of font-family:’fontname’;
    but nothing is working…

    My site is not public yet so I cannot link to it.

    stephencottontail

    (@stephencottontail)

    Can you temporarily enable debugging and see if any errors appear? Can you use a web inspecting tool like Firebug and see if any errors appear?

    Theme Author Ben Ritner – Kadence WP

    (@britner)

    Hey, if your trying to set the p font the theme options is doing that in the typography settings. Those settings would be overriding your css. You would need to make your css more important by adding the “!important” or adding a deeper css selector.

    So like this

    body p {
    font-family: 'fontname';
    }

    Or

    p {
    font-family: 'fontname' !important;
    }

    Kadence Themes

    Thread Starter danina84

    (@danina84)

    I’ll give that a try, thank you! Should I deselect any fonts in the theme settings additionally?

    Theme Author Ben Ritner – Kadence WP

    (@britner)

    That won’t matter. You can if you like but if you add the css it should work fine.

    Kadence Themes

    Thread Starter danina84

    (@danina84)

    Hi,
    it worked, thank you. Would you mind telling me what class the main navigation is so that I can change the menu’s font?
    Thanks a lot.

    Theme Author Ben Ritner – Kadence WP

    (@britner)

    #nav-main ul.sf-menu a {
    font-family: lato;
    }

    Kadence Themes

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘@font-face’ is closed to new replies.