Created
September 20, 2014 15:19
-
-
Save roachhd/530569b61813fdf96029 to your computer and use it in GitHub Desktop.
for adding a second theme to use a a mobile them to a wordpress site
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 | |
include("Mobile_Detect.php"); | |
$detect = new Mobile_Detect(); | |
if (!$_SESSION['switched'] | |
&& !is_admin() | |
&& $detect->isMobile() | |
&& empty($_REQUEST['wptheme']) | |
&& get_current_theme() != 'My%20Mobile%20Page%20V3%20Wordpress%20Theme') { | |
$_SESSION['switched'] = true; | |
header('Location: http://yourwebsiteurl.com?wptheme=My%20Mobile%20Page%20V3%20Wordpress%20Theme'); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment