Wordpress主题与IE8不兼容,请为IE8添加自定义启动页


Wordpress theme not compatible with IE8, add custom splash page for IE8?

所以我一直在为某人构建这个Wordpress,结果发现主题在"完成"后与IE8不兼容。有人知道如何在wordpress中添加自定义的启动页吗?我试着通过我的header.php添加一些IE8自定义样式表,但这似乎没有奏效。在理想的情况下,我想在IE8上加载一个完全不同的网站。这个主题不是我设计的,我也不完全理解它的结构。http://themeforest.net/item/wisey-high-performance-wordpress-theme/14657503

这是我添加到header.php 的代码

<!--[if lt IE 9]>
<link rel="stylesheet" type="text/css" href="  <?php echo get_stylesheet_directory_uri(); ?>/ie-8-style.css" />
<![endif]-->

在我的css文件中有一个名为ie-8-style.css的css文件,我想做的是在用户运行IE8时隐藏网站的全部内容,并显示不支持浏览器的消息。

提前感谢!

我添加了这个

<!--[if lt IE 9]>
<link rel="stylesheet" type="text/css" href="<?php echo get_stylesheet_directory_uri(); ?>/ie-8-style.css" />
<![endif]-->

到我的page.php和这个

function wisey_load_scripts(){
    // Register or enqueue scripts
    wp_enqueue_script('bootstrap',  get_template_directory_uri(). '/js/bootstrap.min.js', array('jquery'), '3.0.1' );
    wp_enqueue_script('bootstrap',  get_template_directory_uri(). '/js/bootstrap.min.js', array('jquery'), '3.0.1' );
    wp_enqueue_script('plugins-scripts', get_template_directory_uri() .'/js/plugins.js', array('jquery'), '3.2', true);
    wp_enqueue_script('scripts', get_template_directory_uri() .'/js/functions.js', array('jquery'), '3.2', true);
    wp_register_script('Google-map-api',  'http://maps.google.com/maps/api/js?sensor=false', array('jquery'), '3.2', false);
    wp_register_script('Google-map',  get_template_directory_uri().'/js/gmap3.min.js', array('jquery'), '3.2', false);
    if(preg_match("/MSIE [23456789].0/",$_SERVER['HTTP_USER_AGENT']) ){
   wp_enqueue_style('css/ie-8-style.css');
}

就是我的functions.php wisey_load_scripts函数的样子。

因此,它所做的是检查浏览器是否为IE8或更低版本,如果是,则加载自定义样式表和

 if(preg_match("/MSIE [23456789].0/",$_SERVER['HTTP_USER_AGENT']) ){
   wp_enqueue_style('css/ie-8-style.css');
}

零件也应该这样做吗?

当我在IE上加载它时,模拟和文档设置为IE8,当自定义css告诉浏览器隐藏body元素时,似乎没有任何变化。

    /* STYLING FOR IE8 */
body, {
  display: none !important;
}