[Resolved] Tried changing font, but not in effect

Home Forums Support Tried changing font, but not in effect

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1302286
    Ashin

    I’m trying to change the font style of my website to Proxima Nova. Here is what I did.

    1. Uploaded woff, woff2, eot and ttf formats to Media folder.
    2. Using Simple CSS added the following CSS code –

    @font-face {
    font-family: ‘Proxima Nova’;
    src: url(‘https://sitename.com/wp-content/uploads/2020/05/proximanova-regular-webfont.eot’); /* IE9 Compat Modes */
    src: url(‘https://sitename.com/wp-content/uploads/2020/05/proximanova-regular-webfont.eot?#iefix’) format(’embedded-opentype’), /* IE6-IE8 */
    url(‘https://sitename.com/wp-content/uploads/2020/05/proximanova-regular-webfont.woff2’) format(‘woff2’), /* Super Modern Browsers */
    url(‘https://sitename.com/wp-content/uploads/2020/05/proximanova-regular-webfont.woff’) format(‘woff’), /* Pretty Modern Browsers */
    url(‘https://sitename.com/wp-content/uploads/2020/05/proximanova-regular-webfont.ttf’) format(‘truetype’), /* Safari, Android, iOS */
    }

    Changed the site name in the above code for privacy reasons.

    3. Then using Code Snippets, added two codes.

    PHP code for adding Proxima Nova to GeneratePress list

    add_filter( ‘generate_typography_default_fonts’, function( $fonts ) {
    $fonts[] = ‘Proxima Nova’;

    return $fonts;
    } );

    Then to remove Google Fonts –

    add_action( ‘wp_enqueue_scripts’, function() {
    wp_dequeue_style( ‘generate-fonts’ );
    } );

    4. Then I changed everything to Proxima Nova in the Typography of Customiser.

    But after all, there seems to be no change. Would you help me understand what went wrong? I got all these codes from this forum and your help guides.

    #1302692
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    All of your quotes in your CSS are “curly” quotes. Can you retype them so they’re straight quotes?

    That might fix it.

    Let me know 🙂

    #1302926
    Ashin

    I’ve changed it all. But still not working.

    #1303169
    Ashin

    It does work when I put the option of ‘Default’ in pages built using Elementor. That means, the font is uploaded correctly and is set as ‘Default’ font when Elementor check for it. But it’s not showing on elements that are shown from GeneratePress’s side. eg- font on the home page or on any page built without elementor.

    #1303232
    David
    Staff
    Customer Support

    Hi there,

    in your fontface CSS you have a , comma after the last font rule – remove that.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.