Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

Lay Theme Forum

  1. Home
  2. General Discussion
  3. Trouble adding a font family using CSS

Trouble adding a font family using CSS

Scheduled Pinned Locked Moved General Discussion
4 Posts 2 Posters 167 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    fmenes
    wrote on last edited by
    #1

    Hi there,

    I have been trying to find a way to import a local font family on my website for the past afternoon without success. I have successfully managed to import them one by one but would really like to find a way to group everything altogether as a family as the font might change over time.
    I have tried using custom css, using an extra CSS to be given to LayTheme when importing the font and it does not work that way. I refered to multiple topics like this, this, this and this one but none of them fixed anything.
    Here's a preview of the code for the font family's CSS :

    @font-face {
        font-family: 'GT America';
        src: url('https://triplesine.com/wp-content/themes/fonts/gtamerica/GT-America-Standard-Regular.woff') format('woff'),
                url('https://triplesine.com/wp-content/themes/fonts/gtamerica/GT-America-Standard-Regular.woff2') format('woff2'),
                url('https://triplesine.com/wp-content/themes/fonts/gtamerica/GT-America-Standard-Regular.ttf') format('truetype');
            font-weight: 400;
            font-style: normal;
            font-display: swap;
    }
    
    @font-face {
        font-family: 'GT America';
             src: url('https://triplesine.com/wp-content/themes/fonts/gtamerica/GT-America-Standard-Black.woff') format('woff'),
                url('https://triplesine.com/wp-content/themes/fonts/gtamerica/GT-America-Standard-Black.woff2') format('woff2'),
                url('https://triplesine.com/wp-content/themes/fonts/gtamerica/GT-America-Standard-Black.ttf') format('truetype');
            font-weight: 900;
            font-style: normal;
            font-display: swap;
    }
    
    

    The infos given for LayTheme import ;

    Font name: GTAmerica
    
    Link tag: <link href="https://triplesine.com/wp-content/themes/fonts/gtamerica/gtamerica.css" rel="stylesheet" type="text/css">
    
    "font-family" CSS: font-family:’GT America’, sans-serif;
    

    Let me know if there are any other solutions to try. This font family has a lot of variants and it will save a lot of time to have it grouped. Thank you !

    1 Reply Last reply
    0
    • arminunruhA Offline
      arminunruhA Offline
      arminunruh
      Global Moderator
      wrote on last edited by
      #2

      please send a link

      1 Reply Last reply
      0
      • arminunruhA Offline
        arminunruhA Offline
        arminunruh
        Global Moderator
        wrote on last edited by
        #3

        maybe it is easier to just add it via lay options → webfonts

        1 Reply Last reply
        0
        • F Offline
          F Offline
          fmenes
          wrote on last edited by
          #4

          Hey Armin ! I figured it out in the end :
          First I think there was an issue with the fact that I was using a space in the name of the font. Then I only used .woff2 as mentioned here. Here's the code input now for people that need it. This is both in the custom CSS and the file.css supplied to the Add by "<link>" tag and CSS webfonts option of LayTheme.

          @font-face {
              font-family: 'GTAmerica';
              src:    url('/wp-content/themes/fonts/gtamerica/GT-America-Standard-Ultra-Light.woff2') format('woff2');
                  font-weight: 100;
                  font-style: normal;
                  font-display: swap;
          }
          
          @font-face {
              font-family: 'GTAmerica';
              src:    url('/wp-content/themes/fonts/gtamerica/GT-America-Standard-Thin.woff2') format('woff2');
                  font-weight: 200;
                  font-style: normal;
                  font-display: swap;
          }
          
          

          etc. for the rest of the family fonts.

          Then in the import options :

          Font name : GTAmerica
          Link tag : <link href="https://triplesine.com/wp-content/fonts/gtamerica/gtamerica.css" rel="stylesheet" type="text/css">
          "font-family" CSS: font-family:'GTAmerica';
          

          Maybe this can be added as a mini tutorial on the Lay website ?
          Thanks to everyone at Lay Theme for this great theme : )

          1 Reply Last reply
          1
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          I also code custom websites or custom Lay features.
          💿 Email me here: 💿
          info@laytheme.com

          Before you post:
          1. When using a WordPress Cache plugin, disable it or clear your cache.
          2. Update Lay Theme and all Lay Theme Addons
          3. Disable all Plugins
          4. Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"

          This often solves issues you might run into

          When you post:
          1. Post a link to where the problem is
          2. Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
          3. If the problem is difficult to explain, post screenshots / link to a video to explain it
          Online Users
          Forgot your key, lost your files, need a previous Lay Theme or Addon version? Go to www.laykeymanager.com
          laytheme.com
          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Recent
          • Tags
          • Popular
          • Users
          • Search