wordpress-error

Browser Detection WordPress Plugin & Functions

Providing cross-browser compatibility on your blog / website theme, you must have to be able to detect the browser used by the visitor.
Browser Detection WordPress Plugin & Functions
Method : 1
By using this conditional comments. WordPress itself can detect client browser.

Providing cross-browser compatibility on your blog / website theme, you must have to be able to detect the browser used by the visitor.
Browser Detection WordPress Plugin & Functions

Method : 1

By using this conditional comments. WordPress itself can detect client browser.


Source : http://www.wprecipes.com/how-to-detect-the-visitor-browser-within-wordpress

Method : 2

By Writing your own function without using WordPress browser detection function.

/*Browser Detect*/
function browser_detect(){
							$ipod = stripos($_SERVER['HTTP_USER_AGENT'],"iPod");
		$iphone = stripos($_SERVER['HTTP_USER_AGENT'],"iPhone");
		$firefox = stripos($_SERVER['HTTP_USER_AGENT'],"Firefox");
		$safari = stripos($_SERVER['HTTP_USER_AGENT'],"Safari");
		$ie = stripos($_SERVER['HTTP_USER_AGENT'],"MSIE");
		$opera = stripos($_SERVER['HTTP_USER_AGENT'],"Opera");
		$maxthon = stripos($_SERVER['HTTP_USER_AGENT'],"Maxthon");
		$chrome = stripos($_SERVER['HTTP_USER_AGENT'],"Chrome");
		$netscape = stripos($_SERVER['HTTP_USER_AGENT'],"Netscape");
		$traveler = stripos($_SERVER['HTTP_USER_AGENT'], "Traveler");
		//detecting device
		if ($ipod == true || $iphone == true){
					echo "
"; echo ""; echo ""; echo " You are viewing this site on an Ipod or Iphone "; echo "
"; }elseif($firefox == true){ echo "
"; echo ""; echo ""; echo " You are viewing this site in Firefox "; echo "
"; }elseif($ie == true){ echo "
"; echo ""; echo ""; echo " You are viewing this site in Internet Explorer "; echo "
"; }elseif($netscape == true){ echo "
"; echo ""; echo ""; echo " You are viewing this site in Netscape "; echo "
"; }elseif($traveler == true){ echo "
"; echo ""; echo ""; echo " You are viewing this site in Traveler "; echo "
"; }elseif($maxthon == true){ echo "
"; echo ""; echo ""; echo " You are viewing this site in Maxthon "; echo "
"; }elseif($chrome == true){ echo "
"; echo ""; echo ""; echo " You are viewing this site in Chrome "; echo "
"; }elseif($safari == true){ echo "
"; echo ""; echo ""; echo " You are viewing this site in Safari "; echo "
"; }elseif($opera == true){ echo "
"; echo ""; echo ""; echo " You are viewing this site in Opera "; echo "
"; }else{ echo "
"; echo ""; echo ""; echo " We currently dont know your browser. "; echo "
"; } };

Source : http://snipplr.com/view/25531/

Method : 3

Using WordPress Plugin.
PHP Browser Detection is a WordPress plugin used to detect a user’s browser.

PHP Browser Detection is a WordPress plugin used to detect a user’s browser. It could be used to send conditional CSS files for Internet Explorer, display different content or custom messages anywhere on the page, or to swap out flash for an image for iPhones.

For more info :  http://martythornley.com/downloads/php-browser-detection/

Related posts:

  1. Create simple wordpress plugin From Scratch Part-2
  2. Create simple wordpress plugin From Scratch Part-1
  3. Cross Browser Drop Shadow for all side