• The Plugin doesn’t work with the wp_redirect() function Code Reference.
    I’ve create a function to redirect to subpage:

    
    add_action( 'template_redirect', 'redirect_to_subpage');
      function redirect_to_subpage() {   
        global $post;
        $pagekids = get_pages("child_of=".$post->ID."&sort_column=menu_order");
        $emptycontent = get_post_field('post_content', $post->ID);	
        if ($pagekids && !$emptycontent) {
          $firstchild = $pagekids[0];
          return wp_redirect(get_permalink($firstchild->ID));
          exit;
        }
      }
    

    When the Cache plugin are enabled the redirection doesn’t work.

The topic ‘Problem with wp_redirect(); function’ is closed to new replies.