Site logo

Archived topic

Custom font in GP

3 replies · Started by Jose Antonio on December 27, 2018

Viewing posts 1–4 of 4

Hi!

I want to put a custom font in a web created with Generatepress, but font don't shows in the list of typography.

In functions.php, I add this:

function tu_add_system_fonts( $fonts ) {
$fonts[] = 'Fashion-Fetish';
return $fonts;
}

And in CSS, I add this:

@font-face{
font-family: Fashion-Fetish;
src: url(https://www.luispablomateo.com/wp-content/uploads/Fashion-Fetish-Bold_0.woff);
font-weight: normal;
}

@font-face{
font-family: Fashion-Fetish;
src: url(https://www.luispablomateo.com/wp-content/uploads/Fashion-Fetish-Heavy_0.woff);
font-weight: bold;
}

What's wrong?

Hi there,

Your function isn't complete.

It should look like this:

add_filter( 'generate_typography_default_fonts','tu_add_system_fonts' );
function tu_add_system_fonts( $fonts ) {
    $fonts[] = 'Fashion-Fetish';

    return $fonts;
}

Hi Tom,

Great! I made a silly error... :|

Thanks for your help.

You're welcome :)

This archived topic is closed to new replies.