• Resolved totalgraybear

    (@totalgraybear)


    I am developing some custom pages for a WP2.2 blog.
    After submitting a post (post-new.php), the user is returned to the same page which has the form for writing and submitting. This refreshed page now also has a link on top “View post >>”.
    I do not want the user to be returned to the same post-new.php page. (BTW, I don’t understand what’s the point in doing so either).
    I want the User to be taken to the list of blogs or another page. I tried to use the PHP Redirect command in post-new.php, but it gives an error about headers having already been sent. Turns out this is a well documented issue in PHP and has good reasons to behave so. Workarounds like using HTTP page refresh breaks the browser’s Back button flow.
    Using the JS command:
    <script type=”text/javascript”>
    location.replace(“https://address of NewPage”);
    </script>
    causes the browser’s post-new.php page to refresh with the NewPage immediately without waiting for the user to write the post.
    Can anyone help with a solution so that Users are redirected to another page after submitting the Form?
    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Redirect User to another page after submiting blog post’ is closed to new replies.