Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

232
Views
After an update for WordPress and Elementor, wp_redirect not working

Please help me. For some reason, after I did an update for WordPress and Elementor, it failed to run the code inside FUNCTION.PHP

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) && wp_is_mobile()) {
        wp_redirect(get_permalink(5756));
    }
        
    if (is_page(5756) && !wp_is_mobile()) {
        wp_redirect(get_permalink(4658));
    }
}
add_action('template_redirect', 'home_redirect');
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!