I downloaded some blank wordpress-theme files and started filling them with own php, html and css.
I used the following code to enque a google webfont:
function load_fonts() {
wp_register_style('googleFonts', 'http://fonts.googleapis.com/css?family=Tauri');
wp_enqueue_style( 'googleFonts');
}
add_action('wp_print_styles', 'load_fonts');
But I would like to add another webfont. I tried two things:
1: Adding it in the wp_register_style with a ‘,’
function load_fonts() {
wp_register_style('googleFonts', 'http://fonts.googleapis.com/css?family=Tauri','http://fonts.googleapis.com/css?family=Muli');
wp_enqueue_style( 'googleFonts');
}
add_action('wp_print_styles', 'load_fonts');
2: Duplicate:
function load_fonts2() {
wp_register_style('googleFonts2', 'http://fonts.googleapis.com/css?family=Muli');
wp_enqueue_style( 'googleFonts2');
}
add_action('wp_print_styles', 'load_fonts2');
Unfortunately both ways didn’t work. Can anybody tell me why the ways above don’t work,
and how I can add multiple webfonts.
Thank you in advance!
Use the
|
pipe separator when requesting multiple families from the webfonts API.Documentation – Cntrl+F
multiple