• Hello,

    I am fully aware that there are many other threads about this. I already read them and I must admit that I don’t really understand what they mean. They seem to presume a lot of things that I am not acquainted with, hence they’re unintelligible to me.

    Here’s my problem:

    I bought a font from myfonts and put it into the folder of my theme/template (assuming that it’s the same).

    Now the “getstarted” file says something about including a reference to my kit. Whatever that’s supposed to mean, I don’t understand it. THere is this line “<link rel=”stylesheet” type=”text/css” href=”MyFontsWebfontsKit.css” ” that I’m supposed to put into my header.

    But where is my header? Is it the file “header.php”? And where exactly do I have to copy this line to?

    As a 3rd step, I’m supposed to “edit my css”. As far as I could understand, the css is the “style.css” file that I can access via the editor of my theme. Is that right?
    I’m being told to add the following line to my html:

    .NeuzeitSLT-BookHeavy {
    font-family: NeuzeitSLT-BookHeavy;
    font-weight: normal;
    font-style: normal;
    }

    But what do they mean by “html”? Just the code? But where, in what file? And in what position in that file?

    As you might have realized, I’m feeling totally lost and frustrated. I’ve spent 6 hours with this and didnt get one step ahead.

    I’d be extremely happy aber every help.

    Many thanks in advance,

    drbutterface

Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Assuming you put the CSS file you downloaded in a into your theme’s directory, you’d add it to your site by putting this in your theme’s functions.php file:

    add_action( 'wp_enqueue_scripts', 'myfonts_enqueue_styles' );
    function myfonts_enqueue_styles() {
           wp_enqueue_style( 'myfonts', 'MyFontsWebfontsKit.css' );
    }

    You’d add references to that font family appropriately in your CSS.

    To add CSS: If you are using WordPress 4.7, use the “Custom CSS” option in the customizer. If your theme has a custom CSS option, use that to add the CSS shown above. If not, install the plugin Simple Custom CSS. Or, if you have Jetpack installed, enable its Custom CSS module.

    Learn the Chrome Developer Tools to help you see and test changes to your CSS.

    Of course, you probably should be doing this in a child theme and not in your theme files themselves.

    Thread Starter drbutterface

    (@drbutterface)

    Hello Steve,

    thanks for your reply.

    I didn’t put any CSS file anywhere and I didnt download any CSS file. I just moved the MyFontsWebfontsKit-Folder into the folder of my theme (suidobashi). That’s basically all I have done.

    The MyFontsWebfontsKit-folder contains 4 files

    32EADF_0_0.eot
    32EADF_0_0 (no suffix, but the details say it’s a ttf)
    32EADF_0_0.woff
    32EADF_0_0.woff2

    Like I said, I don’t know or understand what a CSS is, where I find it and what it does.

    Of course I can follow your steps to add a new CSS (in german it says “additional CSS”) in the customizer and just copy your code into it.

    But I wouldn’t know what “You’d add references to that font family appropriately in your CSS.” is supposed to mean.

    Thanks again,

    drb

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    If you have no idea what your doing, why are you trying to do this? I’m asking that seriously.

    Where is this file: MyFontsWebfontsKit.css ?

    Like I said, I don’t know or understand what a CSS is, where I find it and what it does.

    I strongly suggest you bring in a developer to help you with this. You can find qualified folks on https://jobs.wordpress.net or check out a local WordPress meetup (check https://meetup.com) to ask for help from some local experts.

    Thread Starter drbutterface

    (@drbutterface)

    Thanks for your reply. I’m trying to do this because I need the website and I need to learn somehow – in the meantime I solved the issue with the “use any font” – plugin.

    Thanks a lot for taking your time to help me, I appreciate.

    I believe once you add that CSS code to the “Additional CSS” text field you will have a new active class that you can add to any html element, i.e. <p> tags etc.

    Assuming you added Steve’s code to your function.php file, and you added the CSS (short for cascading stylesheets) you can then go into your template files, these look like page.php or header.php and contain HTML and occasionally PHP.

    Find a <p> or <h1> tag and add the .NeuzeitSLT-BookHeavy class (classes are a CSS convention) to the tag like so <p class="NeuzeitSLT-BookHeavy"> <em>your text here</em></p>.

    If you wish to not add the code to each tag and wish to apply the font style to all h1, or h2, or p tags, change the CSS code found in the Additional CSS text field like so:

    p, h1, h2, h3 {
    font-family: NeuzeitSLT-BookHeavy;
    font-weight: normal;
    font-style: normal;
    }

    And add any html element tag like I did above, followed by commas (except for the last tag).

    It is great that you are learning to code! Keep it up, and may I add looking into a few resources like this free Udacity course on HTML and CSS.

    Note: Please take Steve’s advice about hiring a developer if you wish to make changes to your live site and have users actively using the site. Learn to code on a development site, not the production.

    Best of luck!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Can’t get font from myfonts.com to work’ is closed to new replies.