How to add CSS and JS files on node pages from theme's template.php I am trying to add JavaScript and CSS files to one node type page from my template.php file but it is not working.  Here is my template.php code: 

&lt;?php
// $Id: template.php,v 1.13 2010/12/14 01:04:27 dries Exp $

function mttheme_preprocess_html(&amp;$variables) {
  $node = node_load(arg(1));
  if ($node-&gt;type = 'sales_team_page') {
    drupal_add_css('misc/jquery.fancybox-1.3.4.css');
    drupal_add_js('misc/jquery.mousewheel-3.0.4.pack.js',
      array('type' =&gt; 'file', 'scope' =&gt; 'header')
    );
    drupal_add_js('misc/jquery.fancybox-1.3.4.pack.js',
      array('type' =&gt; 'file', 'scope' =&gt; 'header')
    );
    drupal_add_js('misc/jquery.fancybox-calls.js',
      array('type' =&gt; 'file', 'scope' =&gt; 'header')
    );
  }
}


Does anyone know why it is not working?
Since you want your CSS and JavaScript when displaying a node, you can add the files it in the preprocess function for the node template. Also, as stated in their documentation, when adding a file, the first argument for drupal_add_css() and drupal_add_js() is the path the CSS/JavaScript file relative to the base_path(). You can use drupal_get_path('theme', 'THEME') to get the path of your theme relative to the base path.

function THEME_preprocess_node(&amp;$variables) {
  if ($variables['view_mode'] == 'full') {
    $node =&amp; $variables['node'];
    if ($node-&gt;type == 'sales_team_page') {
      $path = drupal_get_path('theme', 'THEME');
      drupal_add_css($path . '/misc/jquery.fancybox-1.3.4.css');
      drupal_add_js($path . '/misc/jquery.mousewheel-3.0.4.pack.js', array('type' =&gt; 'file', 'scope' =&gt; 'header'));
      drupal_add_js($path . '/misc/jquery.fancybox-1.3.4.pack.js', array('type' =&gt; 'file', 'scope' =&gt; 'header'));
      drupal_add_js($path . '/misc/jquery.fancybox-calls.js', array('type' =&gt; 'file', 'scope' =&gt; 'header'));
    }
  }
}


Also, doing $node = node_load(arg(1)); to load the currently viewed node is unsafe and wrong. If you have a non node page at whatever/42 but have an existing sales_team_page node with nid = 42, you will load this node and add your CSS and JavaScript files even if the user is not viewing the node.