Drupal - How to edit <head> info

If the theme you use does not provide the file for the header, it means that Drupal is using the default one, which is now provided by a module called "system". The file is called html.tpl.php

Just copy this file into your theme, and edit it.


You need to copy default html.tpl.php from system module directory.

Or you can using function drupal_add_html_head to override or add new head tag.

// First, we must set up an array
$element = array(
  '#tag' => 'link', // The #tag is the html tag - <link />
  '#attributes' => array( // Set up an array of attributes inside the tag
    'href' => 'http://fonts.googleapis.com/css?family=Cardo&subset=latin',
    'rel' => 'stylesheet',
    'type' => 'text/css',
  ),
);
drupal_add_html_head($element, 'google_font_cardo');

If you want to change the head tag, you will need to use html.tpl.php

Tags:

Theming

7