Drupal – Adding CSS for a specific URL or Path

If you want to add CSS only for a specific path in Drupal, you can use the following code:


if(strstr($_SERVER['REQUEST_URI'], "PieceorAllofURL")) {
drupal_add_css(sites/domain.com/themes/themename/css/loveteachers.css', 'theme', 'all');
}




Leave a Reply

Your email address will not be published. Required fields are marked *