Trying to redirect one page only, getting an error on mobile.
-
So I put this
<?php if(is_mobile() && get_the_ID() == 7) { wp_redirect('http://www.google.com'); exit;} ?>
in my header.php, because I read somewhere that is where I should put it. However, I get an error when I visit page id 7 on a mobile browser.
“Warning: Cannot modify header information – headers already sent by (output started at /home/mysite/public_html/mysite.net/wp-content/themes/childtheme1/header.php:13) in /home/mysite/public_html/mysite.net/wp-includes/pluggable.php on line 1173“
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Trying to redirect one page only, getting an error on mobile.’ is closed to new replies.