Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1138324
    Eric
    Participant

    Hey I’ve been told one of the reasons my website is slow is because of the way my google fonts are being added, so I was just curious to know if there’s one method for adding fonts that’s better than the others (specifically for someone who’s an X user using a child theme).

    I’ve seen previous threads where the recommendation was to add the @font-face code to the style.css (https://community.theme.co/forums/topic/custom-font-2/#post-142444) and I’ve seen others recommending that I add the google font links directly into the header.php file, so I’d just like to know what’s recommended (keeping in mind that I’m still a novice when it comes to these types of modifications).

    Currently I’ve been adding most of my fonts through CSS (since each page typically uses its own font), however I can’t seem to remember if I had to do anything special to get these fonts to work (since this was done early on in the development process). So if you could let me know what my setup is versus what’s recommended that would be very much appreciated.

    Also, I noticed that I have this in my stylesheet:
    @import url(https://fonts.googleapis.com/css?family=Nothing+You+Could+Do);
    @import url(https://fonts.googleapis.com/css?family=Mr+Bedfort);

    And I was just wondering if I could delete that, or is actually doing something?

    Let me know and I thank you in advance!

    #1138325
    Eric
    Participant
    This reply has been marked as private.
    #1138742
    Friech
    Moderator

    Hi There,

    Thanks for writing in! The solution provided on this post: https://community.theme.co/forums/topic/custom-font-2/#post-142444 is adding a custom font on your own server. Meaning the font files reside on your own server, as opposed to Google font that is reside on the Google server.

    For requesting a Google font, the best way is adding the @import statement on top of your child theme’s style.css file.

    Don’t remove that, that is the line for requesting the Google font. The speed will depends on how heavy the fonts is and on the performance (optimise) of your site overall.

    Hope this shed some lights.

    Cheers!

  • <script> jQuery(function($){ $("#no-reply-1138324 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>