Sorry to repeat this question, but the answers I have found here and via Google aren't working for me. I'm using the P2 theme, have customized a page template so that it shows all of the child pages of a parent, and all of the cool in-place editing is working just dandy (surprising and very welcome too - great work Automattic!).
The issue is that the comment feature takes you to the single of the page you've commented on, and the redirect code I've tried from here and the Internet at large just doesn't seem to work.
To be specific, working in comment-form.php, I'm trying to redirect the user from from going to the page they've just commented on back to the parent page, which in my template shows the child page and comments.
I've added:
'
<?php $parent_permalink = get_permalink($post->post_parent); ?>
<input type="hidden" id="redirect_to" name="redirect_to" value="<?php $parent_permalink; ?>/">
'
to comment_form.php just below the table which ends the actual form, and just above the 'endif' and 'doaction' statements for the comment.
I've tested the parent_permalink output by echoing it out, and it does give up the parent, so my issue must be with my ignorance of the use of the 'redirect_to' function.
Anyone have any ideas what I'm doing wrong?
Thanks in advance for any help!
David