Skip to content

Instantly share code, notes, and snippets.

@jeremycaldwell
Created August 30, 2013 22:58
Show Gist options
  • Save jeremycaldwell/6395101 to your computer and use it in GitHub Desktop.
Save jeremycaldwell/6395101 to your computer and use it in GitHub Desktop.
Drupal 7 - Add CSS for specific paths
function THEMENAME_preprocess_page(&$vars) {
// Add "addcourse.css" to Add Course page only
if(strstr($_SERVER['REQUEST_URI'], "admin/commerce/products/$path_alias")) {
drupal_add_css(
path_to_theme() . '/css/addcourse.css',
array(
'group' => CSS_THEME,
)
);
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment