0

Only for front page I want separate css body class. If a apply in html.tpl.php then it is applicable on each page. How can I apply condition for front page?

0
0

In your template.php check the drupal_is_front_page function, if it is true use the drupal_add_css to load extra css styles.

2
  • In template.php,if (drupal_is_front_page()) { drupal_add_css(drupal_get_path('theme', 'mytheme').'/css/home.css'); }, whats wrong in this? – nomeer May 5 '15 at 9:25
  • you need to put this code in THEME_preprocess_page – M a m a D May 5 '15 at 10:09

Not the answer you're looking for? Browse other questions tagged or ask your own question.