title: WP_redirect not working (header already sent in pluggable.php)
body: <p>I want to use this code in a template file:</p>
  
  <pre><code>if ( wp_is_mobile() ) {
  wp_redirect( "/shop-mobile", $status );
  }
  </code></pre>
  
  <p>but it says: header already sent by /filewithcode in .../wp_includes/pluggable.php on line 1196</p>
  
  <p>I tried to clean the pluggable document from spaces.. what else could be the issue here? Thank you</p>