Udegbunam Asked “How i hide my content from IE6 Users?”

Hi again. I know i can’t write near 20 days. But Udegbunam asked me a question on this post. I try some code on this problem and i found a solution for this. You know, i write an article about using  Two or more single php. I used some if and else option for change single.php for each category. With this code we can change our index.php for IE6 users. Nearly simple code and we can use this with different browsers (IE7, Safari etc.).  Lets begin!

Before start make a backup of your theme’s index.php. I used default theme’s files for this. Your template can have different files or codes.

Firstly we have to copy our real index.php twice. After that rename them with index-ie6.php and index-real.php. Clear index.php‘s code and place that code below;

<?php
if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 6') !== false) {
include(TEMPLATEPATH . '/index-ie6.php'); }
else { include(TEMPLATEPATH . '/index-real.php');
}
?>

After that we change index-ie6.php for IE6 users. I simply change have_posts function with a h3 :). Here is the index-ie6.php;

<?php
/**
 * @package WordPress
 * @subpackage Default_Theme
 */

get_header(); ?>

	<div id="content" class="narrowcolumn" role="main">
<div><h3>Sorry You're using Internet Explorer 6 </h3></div>

	</div>

<?php get_sidebar(); ?>

<?php get_footer(); ?>

Don’t change index-real.php’s codes. This is the real index.php of your theme.
That’s All. There is no more code :) If you want i take some screenshots for this. IE6, IE8 and Firefox.


Related posts:

If you enjoyed this post, make sure you subscribe to my RSS Feed
No comments yet.

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
 

Highslide for Wordpress Plugin