Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?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