Making an IE only site (Like a Mobile only site)

For those who are curious, I’m changing the theme but this theme relies on CSS3 and HTML5 and displays very ugly in IE 8 or below. – Especially the navigation.

What I want to do is keep my old theme and use it for IE users only, I assume if this can be done for a mobile site, it can for IE.
Would it be easier to just get another WP installation and duplicate the content (What’s the easiest way to do this?).
Or is there a method, such as the mobile method to redirect users to that theme.

Read More

My plan was, create a second installation with the existing theme then somehow grab the content from the main site and add and IF code redirecting IE users. Is this possible, or is there an easier/ or simpler way?

Related posts

Leave a Reply

1 comment

  1. maybe you can somehow use template redirect? I’m not too clear on how it works, but it may be worth investigating.

    function my_check_is_ie() {
        global $is_winIE;
        if ( ! $is_winIE ) return;
    
        // load template for IE
        include(TEMPLATEPATH . '/IE_template.php');
    
        // or maybe?
        if( is_home() ) include(TEMPLATEPATH . '/IE_home.php');
        elseif( is_single() ) include(TEMPLATEPATH . '/IE_single.php');
        // etc.
    }
    
    add_action('template_redirect', 'my_check_is_ie');
    

    Edit– ok, I think I’ve figured it out. I haven’t tested this in the wild, so make sure it works first! You’ll have to make this a plugin, since once the theme is loaded it’s too late to pull the theme switch…

    <?php
    /*
    Plugin Name: randomkljsaduiyerth
    */
    global $is_winIE;
    if($is_winIE){
        add_filter('template', 'my_switch_themes');
        add_filter('stylesheet', 'my_switch_themes');
    }
    function my_switch_themes(){
        // return the name of your IE theme
        return 'my-IE-theme-Name-Here'; 
    }
    

    Edit2

    you could add another check for the presence of a GET variable if you wanted to let people switch via a link like: http://yourdomain.com/?IE_version

    if( isset($_GET['IE_version']) ):
        // add_filter here, or better yet if you're doing a number of checks,
        // set a flag if any check is true and add_filter last
    endif;
    

    you could also use cookies to store the theme preference

    // check the cookie
    if( isset($_COOKIE["my_domain_cookie"]) )
    
    // set the cookie
    setcookie("my_domain_cookie", "My Cookie Val", time()+60*60*24*30);