Site logo

[Resolved] Local Font – Only 1 will work

Home Forums Support [Resolved] Local Font – Only 1 will work

Home Forums Support Local Font – Only 1 will work

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #2490869
    Brenden

    I am attempting to add 2 local fonts, but only 1 will work at a time. Only the font listed last in the CSS works. Both fonts will work, but only if they are listed last.

    Here is the CSS

    @font-face {
        font-family: 'Melodiously';
        src: url('/wp-content/themes/montana-bride/Melodiously.woff2') format('woff2'),
             url('/wp-content/themes/montana-bride/Melodiously.woff') format('woff');
        font-weight: normal;
        font-style: normal;
        font-display: swap;
    }
    @font-face {
        font-family: 'Henderson';
        src: url('/wp-content/themes/montana-bride/HendersonSans.woff2') format('woff2'),
             url('/wp-content/themes/montana-bride/HendersonSans.woff') format('woff');
        font-weight: normal;
        font-style: normal;
        font-display: swap;
    }

    Here is a staging url – https://montanabride.wpengine.com/style-guide/

    Heading 1 is attempting to load ‘Melodiously’ but it is not working because it is first in the css.
    Heading 2-6 is loading ‘Henderson’.

    #2490908
    Fernando
    Customer Support

    Hi Brenden,

    How are you adding the @font-face rules currently? Can you try adding them through Appearance > Customize > Additional CSS to test?

    Let us know how it goes.

    #2491904
    Brenden

    That solved the problem. The CSS was in the child theme, but I am thinking there must be an issue with that file. Thank you for the idea to move it to Customize > Additional CSS.

    #2492143
    Fernando
    Customer Support

    I see. Perhaps there’s a syntax error somewhere there or some other issue.

    You can try these CSS error checkers to test:

    https://codebeautify.org/cssvalidate
    http://csslint.net/

    You’re welcome, Brenden!

    #2493334
    Brenden

    Yep, I had an error. 🙁 Thank you for your help!

    #2493574
    Fernando
    Customer Support

    You’re welcome, Brenden!

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.