Created
April 13, 2016 12:37
-
-
Save frankschrijvers/366d4c8a44beb4accd145d77c866c25f to your computer and use it in GitHub Desktop.
Redirect homepage on mobile
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 | |
//* Do NOT include the opening php tag shown above. Copy the code shown below. | |
//* Redirect homepage on mobile | |
add_action( 'wp_head', 'wps_params', 10 ); | |
function wps_params() { | |
?> | |
<script> | |
if (window.location.pathname == '/' && jQuery(window).width() <= 480) { | |
window.location = "/webshop/"; | |
} | |
</script> | |
<?php | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment