Created
January 21, 2015 20:28
-
-
Save DenisLeblanc/d779e0fe3941ebfb8c22 to your computer and use it in GitHub Desktop.
iPad and iPhone conditionals for WordPress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// CREATE IPAD AND IPHONE CONDITIONALS | |
function is_ipad() { | |
$is_ipad = (bool) strpos($_SERVER['HTTP_USER_AGENT'],'iPad'); | |
if ($is_ipad) | |
return true; | |
else return false; | |
} | |
function is_iphone() { | |
$cn_is_iphone = (bool) strpos($_SERVER['HTTP_USER_AGENT'],'iPhone'); | |
if ($cn_is_iphone) | |
return true; | |
else return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment