Support » Fixing WordPress » redirect after comment post not jumping to new comment?

  • I have a fairly new WP 2.0.3 install running on apache 1.3 with php 4 and I am using a template based on the old classic single index.php with comments.php

    I’ve noticed one problem that’s bothering me.

    After a NEW comment is posted, wp-comments-post.php does it’s job and redirects back to the original post page.
    HOWEVER, is it not supposed to send that person back to see their comment by adding #comment-1234 to the end of the URL?

    I thought this was the purpose of get_permalink at the end of that function, and inject it into the location header?

    I am using the second permalink option:
    Date and name based

    Thanks for any help!

Viewing 2 replies - 1 through 2 (of 2 total)
  • I’m having this problem too. Is there an option to turn it on?

    If I remember right, they had removed that option before, for 2.0, 2.0.1, 2.0.2, 2.0.3.. I’m not positive if they re-added it for the latest of 2.0.4..

    But, you can do the following:

    The code changes are as such:

    Open the wp-comments-post.php file.

    Near bottom, find this line:

    wp_redirect( $location );

    Then replace with this line:

    wp_redirect( $location . “#comment-” . $comment_id );

    I hope this helps.


Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘redirect after comment post not jumping to new comment?’ is closed to new replies.