WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.



share|improve this question

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

This question was marked as an exact duplicate of an existing question.

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.