I have comments enabled on different types of pages in Wordpress (archive, tag, search, main page), and after a user posts a comment I would like them to be redirected back to their referring page, not to the single post page. Any ideas?
4条回答 默认 最新
- dongping4273 2011-04-01 13:25关注
Put this in your functions.php:
add_filter('comment_post_redirect', 'redirect_after_comment'); function redirect_after_comment($location) { return $_SERVER["HTTP_REFERER"]; }
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报