Skip to content

Instantly share code, notes, and snippets.

@killua99
Created July 17, 2013 15:10
Show Gist options
  • Save killua99/6021464 to your computer and use it in GitHub Desktop.
Save killua99/6021464 to your computer and use it in GitHub Desktop.
add css and js in preprocess page
<?php
/**
* Preprocess page.
*/
function mytheme_preprocess_page(&$vars) {
drupal_add_css(path_to_theme() . '/css/foo.css', 'theme', 'all');
$vars['styles'] = drupal_get_css();
drupal_add_js(path_to_theme() . '/js/foo.js');
$vars['scripts'] = drupal_get_js();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment