Here’s how to redirect to a thank you page after you submit comments. And link back to the post it came from .

  1. Create a page and add thank you content .
    • Sample content
      Thank you for comment.
      
       To Return to the specific post that you just came from - <a href="/?p=[post_id]">
  2. Add the code in your functions.php of the current theme
    add_action('comment_post_redirect', 'redirect_to_thank_page'); // Redirect to thank you post after comment
       function redirect_to_thank_page() {
         $id=$_POST['comment_post_ID'];
           return 'https://www.mccallgardens.com/thank-you-for-leaving-a-condolence/?obituary='.$id; 
       }
    
    add_shortcode('post_id', 'get_name');
    
    function get_name() {
    
       return $_GET['obituary'];
    }