• Resolved Claudia

    (@twiggs)


    Hello everyone!

    Ok, so I’m working on a template and I want to customize the menu bar using a kind of font that is not a web-font, but a font I purchased.

    How do I do it?

    It’s really important for me to use that font!

    Thank you so very much!

    Claudia

Viewing 11 replies - 16 through 26 (of 26 total)
  • Thread Starter Claudia

    (@twiggs)

    Done!

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Nice work, so your @font-face code with the correct URLs should be this;

    @font-face {
        font-family: 'katieroseregular';
        src: url('/wp-content/themes/StellaChildTheme/trial_by_cupcakes_-_katierose-webfont.eot');
        src: url('/wp-content/themes/StellaChildTheme/trial_by_cupcakes_-_katierose-webfont.eot?#iefix') format('embedded-opentype'),
             url('/wp-content/themes/StellaChildTheme/trial_by_cupcakes_-_katierose-webfont.woff') format('woff'),
             url('/wp-content/themes/StellaChildTheme/trial_by_cupcakes_-_katierose-webfont.ttf') format('truetype'),
             url('/wp-content/themes/StellaChildTheme/trial_by_cupcakes_-_katierose-webfont.svg#katieroseregular') format('svg');
        font-weight: normal;
        font-style: normal;
    }

    There’s still another step, by the way.

    Thread Starter Claudia

    (@twiggs)

    Done!

    Which one?

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Whoopsidasies!
    This is your @font-face code. I missed out the Fonts folder;

    @font-face {
        font-family: 'katieroseregular';
        src: url('/wp-content/themes/StellaChildTheme/Fonts/trial_by_cupcakes_-_katierose-webfont.eot');
        src: url('/wp-content/themes/StellaChildTheme/Fonts/trial_by_cupcakes_-_katierose-webfont.eot?#iefix') format('embedded-opentype'),
             url('/wp-content/themes/StellaChildTheme/Fonts/trial_by_cupcakes_-_katierose-webfont.woff') format('woff'),
             url('/wp-content/themes/StellaChildTheme/Fonts/trial_by_cupcakes_-_katierose-webfont.ttf') format('truetype'),
             url('/wp-content/themes/StellaChildTheme/Fonts/trial_by_cupcakes_-_katierose-webfont.svg#katieroseregular') format('svg');
        font-weight: normal;
        font-style: normal;
    }

    Thread Starter Claudia

    (@twiggs)

    done ??

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Now… Which page element(s) do you want the font applied to?

    Thread Starter Claudia

    (@twiggs)

    Menu ??

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Then you’ll need to add this in your Child Theme stylesheet;

    div#navigation ul li a {
     font-family:  'katieroseregular';
    }

    But I’d first make that header.php change we discussed in the other thread.

    Thread Starter Claudia

    (@twiggs)

    It’s working, it’s working! Oh whow! Thank you so much!

    By the way what did you change?

    I need to learn about this! I cannot believe that I actually succeeded in creating a Child Theme! This has been such a monster on my head for so long!

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    By the way what did you change?

    I swapped around a couple of lines of code, so the base.css file loads before the style.css file. Otherwise, your base.css styles would have taken precedence over your style.css file, it would have been much harder to add styles in this circumstance.

    It was this;

    <link rel="stylesheet" type="text/css" media="screen" href="<?php bloginfo('stylesheet_url'); ?>"/>
    <link rel="stylesheet" type="text/css" media="screen" href="<?php echo get_template_directory_uri(); ?>/css/base.css"/>

    And I changed to this;

    <link rel="stylesheet" type="text/css" media="screen" href="<?php echo get_template_directory_uri(); ?>/css/base.css"/>
    <link rel="stylesheet" type="text/css" media="screen" href="<?php bloginfo('stylesheet_url'); ?>"/>

    Thanks for contributing to the WordPress community, Claudia ??

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

Viewing 11 replies - 16 through 26 (of 26 total)
  • The topic ‘Fonts on Menu’ is closed to new replies.