Issue with drupal_add_css, can do it by nid but not by alias I am using the drupal_add_css function in my template.php file (Drupal 6) and this code works:

if (arg(0)=="node"&amp;&amp;arg(1)=="74" ) {
drupal_add_css(drupal_get_path('theme', 'mythemename') . '/css/slider.css', 'theme');
  }


However if I use this code, it does not work. 

if (arg(0)=="web-portfolio") {
drupal_add_css(drupal_get_path('theme', 'mythemename') . '/css/slider.css', 'theme');
  }


I am wondering what I am doing wrong. (note "mythemename" is used in place of my actual theme name here and the actual aliased path is example.com/web-portfolio
arg() doesn't work with path as far as I know. I'm sure there are better aproaches to doing this, but I found a bit of a hack.

if(strstr($_SERVER['REQUEST_URI'], "web-portfolio")) {
  drupal_add_css(drupal_get_path('theme', 'mythemename') . '/css/slider.css', 'theme');
}


I wouldn't use this however its not really the Drupal way. You are adding CSS for a slider, I guess that slide is made with views. You could just make your drupal_add_css call from the views template. That way you'll have it even if you change the path.