title: After an update for WordPress and Elementor, wp_redirect not working
body: <p>Please help me. For some reason, after I did an update for <code>WordPress</code> and <code>Elementor</code>, it failed to run the code inside <code>FUNCTION.PHP</code></p>
  <pre><code>add_filter( 'body_class','my_body_classes' );
  function my_body_classes( $classes ) {
      if (!wp_is_mobile()) {
          $classes[] = 'desktop';
      }
       
      return $classes;
       
  }
  
  
  function home_redirect() {
      if (is_page(4658) &amp;&amp; wp_is_mobile()) {
          wp_redirect(get_permalink(5756));
      }
          
      if (is_page(5756) &amp;&amp; !wp_is_mobile()) {
          wp_redirect(get_permalink(4658));
      }
  }
  add_action('template_redirect', 'home_redirect');
  </code></pre>