transmitstudio
11/3/2016 - 10:08 PM

Check for mobile and redirect

Check for mobile and redirect

// add mobile redirect
function xmit_mobile_redirects() {
	if ( wp_is_mobile()) {
		if (is_page('junior-golf' || '17' == $post->post_parent )) {
			echo '<script>{window.location.href = "full url to redirect to";}</script>';
		} else {
			echo '<script>{window.location.href = "other full url to redirect to";}</script>';
		}
	}
}
add_action('wp_head','xmit_mobile_redirects');