Help with adding different stylesheet to one specific page in Drupal 7 using the template.php I am trying to apply a CSS style (games.css) to page--type--games.tpl.php. I am using Drupal 7, and I have created a new content type called "games."

So far, my code works for pulling up the page--type--games.tpl.php, but it has been unsuccessful in applying the CSS stylesheet. This is my current version of the code.

/**
 * Add javascript files for front-page jquery slideshow.
 */
if (drupal_is_front_page()) {
  drupal_add_js(drupal_get_path('theme', 'bluemasters') . '/js/bluemasters.js');
}

function bluemasters_preprocess_page(&amp;$variables, $hook) {
  //some other stuff
  if (isset($variables['node'])) { 
    $variables['theme_hook_suggestions'][] = 'page__type__'. $variables['node']-&gt;type;
    $variables['theme_hook_suggestions'][] = "page__node__" . $variables['node']-&gt;nid;
  }

  if (drupal_get_path_alias("node/{$variables['#node']-&gt;nid}") == 'games') {
    drupal_add_css(drupal_get_path('theme', 'bluemasters') . "/games.css");
  }
}
drupal_get_path_alias("node/{$variables['#node']-&gt;nid}") will be equal to "games" only in the case "games" is the path alias for the node being shown.  

If you just want to verify the content type of the node being shown is "games," then you need to use code similar to the following one:

if ($variables['node']-&gt;type == 'games') {
  drupal_add_css(drupal_get_path('theme', 'bluemasters') . "/games.css");
}


To notice that a page preprocess function is called also for pages that are not associated to nodes; the function should first verify if it gets a node object, before to access it.
The complete code of the preprocess function should be like the following:

function bluemasters_preprocess_page(&amp;$variables, $hook) {
  if (!empty($variables['node'])) { 
    $variables['theme_hook_suggestions'][] = 'page__type__'. $variables['node']-&gt;type;
    $variables['theme_hook_suggestions'][] = 'page__node__' . $variables['node']-&gt;nid;

    if ($variables['node']-&gt;type == 'games') {
      drupal_add_css(drupal_get_path('theme', 'bluemasters') . "/games.css");
    }
  }
}