Load Google Fonts Using Enqueue

Loading a Google Font using the enqueue function allows you to load multiple font weights without making a separate call for each one. This is more efficient than using @import in CSS.

1
2
3
4
5
6
7
8
9
10
** Load Google fonts */
add_action( 'wp_enqueue_scripts', 'custom_load_google_fonts' );
function custom_load_google_fonts() {
    wp_enqueue_style( 
        'google-fonts', 
        'http://fonts.googleapis.com/css?family=Merriweather|Open+Sans', 
        array(), 
        PARENT_THEME_VERSION 
     );
}