[Resolved] Adobe fonts

Home Forums Support Adobe fonts

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1089522
    mackiecompany

    Hi
    Is there safe way of adding adobe typekit fonts, i’ve tried this method from your tube and it crashes my test site.

    Thanks
    Scott

    #1089565
    David
    Staff
    Customer Support

    Hi there,

    that method is the correct way of adding the CSS version of typekit.
    The only reason a crash may occur is if there is an error in your Code Snippet. Does it report any particular error and can you share the code you’re adding?

    #1089585
    mackiecompany

    Hi David,
    I’m using Desktop Server locally and got this message after activating it.

    Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘tu_add_typefit_fonts’ not found or invalid function name in /Users/designmini/Documents/Websites/www.generateblueprint-nov2019.dev.cc/wp-includes/class-wp-hook.php on line 288

    Thanks
    Scott

    #1089594
    David
    Staff
    Customer Support

    Can you share the code you have added?

    #1089597
    mackiecompany

    Yeah sure

    add_filter( 'generate_typography_default_fonts', 'tu_add_typefit_fonts' );
    function tu_add_typekit_fonts( $fonts ) {
        $fonts[] = 'miller-text'; 
        $fonts[] = 'interstate'; 
        return $fonts;
    };
    #1089653
    David
    Staff
    Customer Support

    Hmmm can’t see any reason why that wouldn’t work – try an anonymous function instead:

    add_filter( 'generate_typography_default_fonts', function( $fonts ) {
        $fonts[] = 'miller-text';
        $fonts[] = 'interstate';
    
        return $fonts;
    } );
    #1089764
    mackiecompany

    Hi David,
    That worked
    Thanks
    Scott

    #1089784
    David
    Staff
    Customer Support

    Glad to be of help.
    I can only assume the other code had some ‘funky’ characters within it.

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