Site logo

Archived topic

Enqueue both google fonts and adobe typekit

3 replies · Started by Heather on November 20, 2019

Viewing posts 1–4 of 4

I am using 3 different fonts that I am currently using a hook to bring the linksheets into the <head>, but I would like to enqueue these in my child theme instead.

I know how to enqueue one google font, but not sure how to enqueue multiple font families in one function. My adobe typekit font is also a .css instead of a .js, so I can't use enqueue scripts.

Is there a function that can enqueue style all three of these? Or do I have to do them separately?

Hi there,

You should be able to do something like this:

add_action( 'wp_enqueue_scripts', function() {
    wp_enqueue_script( 'your-font-handle', 'URL TO YOUR SCRIPT' );
    wp_enqueue_script( 'another-handle', 'ANOTHER URL HERE' );
    wp_enqueue_style( 'one-more', 'URL TO THE CSS FILE' );
} );

Let me know if you need more info :)

So I believe all three are css style linksheets (2 google fonts and 1 adobe typekit), so I would just replace script with style?
Also, I want it to live in my head, so under it would I add add_action wp_head() or something like that?

This archived topic is closed to new replies.