• Shiba WordPress Theme Release 2.1 – IE6 Compatibility
    by ShibaShake on

    What?! Another theme release already?

    Usually I would wait – but this one is a compatibility release. After much hair pulling, kicking, and banging my head against the monitor, …

    the Shiba WordPress Theme is now tested and compatible with IE-6, IE-7, IE-8, and FireFox.

    There could still be layout weirdness here and there, so please report any bugs that you see to me. Your help with bug squashing will be greatly appreciated.

    The two key issues with making the theme work with IE-6 are -

    1. Layout

    There are very many layout bugs in IE-6 and they appear most often when you are using floating containers.

    Most of these issues were solved by doing the hasLayout bug fix (e.g. adding a zoom:1; to the containers).

    Others were solved by careful setting of the right container widths. Make sure to insert conditionals into your WordPress theme so that you only generate these additional fixes for IE-6 and don’t complicate your theme in other instances.

    2. Transparent PNGs

    The Shiba WordPress Theme relies heavily on the use of transparent PNGs. Some of these options are turned off for IE-6 because it does not support repeating transparent PNGs.

    Single transparent PNGs are enabled by using the non-standard MS filter command in your CSS file. Below are some examples for setting a transparent PNG background and a transparent PNG image for IE-6.

    This is what I used for setting a transparent PNG background. The code goes in your WordPress theme functions.php file -

    <?php
    if (IS_IE6) :
    ?>
    	.widget_search #searchsubmit {
    		background: none;
    		filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='<?php echo get_bloginfo('url');?>/wp-content/themes/shiba/images/sbutton2.png', sizingMethod='fixed');
    	}
    <?php
    endif;
    ?>

    This is what I used for setting a transparent PNG image -

    <?php
    $img_file = 'blah.png';
    ?>
        <div class="comment-img"
        	<?php if (IS_IE6)
    			echo "style=\"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" . $img_file . "', sizingMethod='fixed'); padding-top:200px;\"";
    		?>
        >
        	<img src='<?php echo  $img_file;?>' width="200" height="200"/>
        </div>
    <?php
    ?>

    3. Check for IE-6

    You will also need a function to check for the client browser type.

    <?php
    function is_ie($version='6')
    {
        $version_str = 'MSIE ' . $version;
        if (isset($_SERVER['HTTP_USER_AGENT']) && 
        (strpos($_SERVER['HTTP_USER_AGENT'], $version_str) !== false))
            return true;
        else
            return false;
    }
     
    define('IS_IE6', is_ie('6'));
    ?>

    If you don’t have to, you really don’t want to muck with IE6 compatibility theme issues. Just find a WordPress theme that is already pre-tested with old versions of Internet Explorer.

    In this way you only need to worry about IE6 compatibility for your own add-ons, which will result in less hair loss and head trauma.

    Related Articles

    Leave a Reply

    Your email address will not be published.

    You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">

    search button search button
    rss