WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Redirect User to another page after submiting blog post (3 posts)

  1. totalGraybear
    Member
    Posted 7 years ago #

    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("http://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

  2. totalGraybear
    Member
    Posted 7 years ago #

    cough, cough, cough...
    anyone there?...........

  3. totalGraybear
    Member
    Posted 6 years ago #

    See here for answer.

Topic Closed

This topic has been closed to new replies.

About this Topic