Home ›
Error loading CSS in IE
Hide all descriptions
Error description:
Ceased to connect to the theme CSS files when viewing through Internet Explorer
The error occurs because of restrictions on the number of IE plug CSS files (problems arise when trying to connect over 30 css files).
The solution lies in the function:
<?php
function phptemplate_preprocess_page(&$vars) {
/**
* Slove 30 CSS files limit in Internet Explorer
*/
$preprocess_css = variable_get('preprocess_css', 0);
if (!$preprocess_css) {
$styles = '';
foreach ($vars['css'] as $media => $types) {
$import = '';
$counter = 0;
foreach ($types as $files) {
foreach ($files as $css => $preprocess) {
$import .= '@import "'. base_path() . $css .'";'."\n";
$counter++;
if ($counter == 15) {
$styles .= "\n".'<style type="text/css" media="'. $media .'">'."\n". $import .'</style>';
$import = '';
$counter = 0;
}
}
}
if ($import) {
$styles .= "\n".'<style type="text/css" media="'. $media .'">'."\n". $import .'</style>';
}
}
if ($styles) {
$vars['styles'] = $styles;
}
}
}
?>This function must be added to the file template.php, which you can find in the folder you are using the theme.
Who's new
- Marat Farkhulin
Who's online
There are currently 0 users and 1 guest online.
Search
Work schedule
Feedback
Workdays
Monday to Friday
Working time
from 10 to 18 Moscow time, GMT +3
Break
from 13 to 14