Skip to content

Instantly share code, notes, and snippets.

@tarikcayir
Last active November 8, 2015 10:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tarikcayir/27d5d1fd4490b9d4aeb5 to your computer and use it in GitHub Desktop.
Save tarikcayir/27d5d1fd4490b9d4aeb5 to your computer and use it in GitHub Desktop.
<?php
/**
* Insert the header.php file. <head><head>
*/
global $post;
$postSlug = $post->post_name; // Get current page slug
// Mobile home page control
if ( wp_is_mobile() && is_front_page() ): ?>
<script>
window.location = "http://www.m.siteadi.com/";
</script>
<?php
// Mobile control
elseif ( wp_is_mobile() ): ?>
<script>
window.location = "http://www.m.siteadi.com/<?=$postSlug?>";
</script>
<?php endif ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment