wp_redirect()
works by sending a Location header. Headers cannot be sent after output has been sent to the browser. So you cannot output any HTML before calling wp_redirect()
.
Using wp_redirect()
after get_header()
never would have worked, which is why it doesn’t work when you roll back. The only way it could’ve worked is if header.php
was completely empty, so get_header()
did not output HTML.