Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

This question already has an answer here:

I'm converting an html/css template to a WordPress theme. The index.html contains the following Google font which I want to include in the header.php : http://fonts.googleapis.com/css?family=Bree+Serif' rel='stylesheet'> Kindly advise how I can do this.

Regards

Debashis

share|improve this question

marked as duplicate by Chip Bennett, s_ha_dum, G. M., Johannes Pille, toscho Oct 3 '13 at 15:41

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer 1

As you probably know it's always a good idea to register and enqueue your styles within you functions.php.

As you can see in the Codex, there is a given order for the parameters of those functions. Simply put the data of the webfont in:

wp_register_style( $handle, $src, $deps, $ver, $media );
wp_enqueue_style( $handle, $src, $deps, $ver, $media );

So you'll probably have something like this in your functions.php:

function load_google_webfonts() {
    wp_register_style( 'bree', 'https://fonts.googleapis.com/css?family=Bree+Serif' );
        wp_enqueue_style('style', get_stylesheet_uri(), array('bree'), '1.0', 'all');
}
add_action( 'wp_enqueue_scripts', 'load_google_webfonts' );
share|improve this answer
    
Created the function in the function in the functions.php but this hasn't had any effect. –  Debashis Sikdar Oct 3 '13 at 12:58
    
Ensure that you have included the wp_head() template tag in your Theme, usually in header.php, immediately before the closing HTML </head> tag. –  Chip Bennett Oct 3 '13 at 13:01
    
You can use the font within your style.css like this: body { font-family: 'Bree Serif', serif; } –  Sven Oct 3 '13 at 13:09

Not the answer you're looking for? Browse other questions tagged or ask your own question.