Site logo

Archived topic

Could you help adding custom font?

5 replies · Started by Silvio on August 20, 2019

Viewing posts 1–6 of 6

Hi, I am trying to add Replica to a new site, but something is not working.

I have this css


/* Replica Regular */
@font-face {
  font-family: 'Replica';
  font-style: normal;
  font-weight: 400;
  src: url('http://staging.picampus.flywheelsites.com/wp-content/themes/generatepress_child/fonts/Replica-Regular.eot'); /* IE9 Compat Modes */
  src: url('http://staging.picampus.flywheelsites.com/wp-content/themes/generatepress_child/fonts/Replica-Regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
       url('http://staging.picampus.flywheelsites.com/wp-content/themes/generatepress_child/fonts/Replica-Regular.woff') format('woff'), /* Modern Browsers */
       url('http://staging.picampus.flywheelsites.com/wp-content/themes/generatepress_child/fonts/Replica-Regular.ttf') format('truetype'), /* Safari, Android, iOS */

/* Replica Light */
@font-face {
  font-family: 'Replica';
  font-style: light;
  font-weight: 300;
  src: url('http://staging.picampus.flywheelsites.com/wp-content/themes/generatepress_child/fonts/Replica-Light.eot'); /* IE9 Compat Modes */
  src: url('http://staging.picampus.flywheelsites.com/wp-content/themes/generatepress_child/fonts/Replica-Light.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
       url('http://staging.picampus.flywheelsites.com/wp-content/themes/generatepress_child/fonts/Replica-Light.woff') format('woff'), /* Modern Browsers */
       url('http://staging.picampus.flywheelsites.com/wp-content/themes/generatepress_child/fonts/Replica-Light.ttf') format('truetype'), /* Safari, Android, iOS */
}

/* Replica Bold */
@font-face {
  font-family: 'Replica Bold';
  font-style: bold;
  font-weight: 700;
  src: url('http://staging.picampus.flywheelsites.com/wp-content/themes/generatepress_child/fonts/Replica-Bold.eot'); /* IE9 Compat Modes */
  src: url('http://staging.picampus.flywheelsites.com/wp-content/themes/generatepress_child/fonts/Replica-Bold.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
       url('http://staging.picampus.flywheelsites.com/wp-content/themes/generatepress_child/fonts/Replica-Bold.woff') format('woff'), /* Modern Browsers */
       url('http://staging.picampus.flywheelsites.com/wp-content/themes/generatepress_child/fonts/Replica-Bold.ttf') format('truetype'), /* Safari, Android, iOS */
}

and this function

add_filter( 'generate_typography_default_fonts', function( $fonts ) {
    $fonts[] = 'Replica';
    return $fonts;
} );

I have the Replica font in the customizer, but it's not rendered.
To view the site use:

USR picampusdev
PWD picampusdev

Thanks in advance

Hi there,

Looks like you've done everything right, but your first @font-face block is missing the closing } character.

Let me know :)

what a shame :(

anyway, I fixed it, but nothing changed.

Very strange. Does it work if you try a different font? I can't see any issues with the way it's set up right now.

well, I did't try, but it's working on the live website

What's working on the live site? Replica?

This archived topic is closed to new replies.