I didn’t know that a WordPress site may crash IE8 before last week. The WordPress site crashed IE8 over again and again after I disabling all the plugins, commenting all the scripts, even disabling all the shortcodes. After eliminating all the impossible, I found out the cause of the problem. It was the first code line in the style.css file of the child theme.
|
1 |
@import url("../the directory name of the parent theme/style.css"); |
I don’t know why it caused the problem, but I do know the quick fix.
1. Comment the @import line in the style.css file of the child theme.
2. Add the following code to the functions.php file of the child theme.
|
1 2 3 4 5 |
function tttt_enqueue_scripts_styles() { wp_enqueue_style( 'parent-theme-css', get_template_directory_uri() . '/style.css' ); } add_action( 'wp_enqueue_scripts', 'tttt_enqueue_scripts_styles' ); |
When I saw the above code on WordPress.tv 2 months ago, I was wondering why bother.