To ensure the popularity of your blog, you need to be able to detect the browser that the visitor is definitely using !! , You can use comments or additions to this work, but I must do this manually. Let’s see how we do it.

Simply add this code to the functions.php file for your template:

add_filter ('body_class', 'browser_body_class');
function browser_body_class ($ classes) {
	global $ is_lynx, $ is_gecko, $ is_IE, $ is_opera, $ is_NS4, $ is_safari, $ is_chrome, $ is_iphone;

	if ($ is_lynx) $ classes [] = 'lynx';
	elseif ($ is_gecko) $ classes [] = 'gecko';
	elseif ($ is_opera) $ classes [] = 'opera';
	elseif ($ is_NS4) $ classes [] = 'ns4';
	elseif ($ is_safari) $ classes [] = 'safari';
	elseif ($ is_chrome) $ classes [] = 'chrome';
	elseif ($ is_IE) $ classes [] = 'ie';
	else $ classes [] = 'unknown';

	if ($ is_iphone) $ classes [] = 'iphone';
	return $ classes;
}

Save the file, and then you can call the foncation via this code

<Body class = "home blog logged-in safari">

That’s all you can later add more effects to your css file

Leave a Reply

Your email address will not be published. Required fields are marked *