Attach link to pages accoding to tags

If you place the code below in single.php file anywhere you want the links to appear in your posts, or inside a function in functions.php and the function tied to a filter or an action like ‘the_content’, the you shold get a list of links to the posts that have the same tag or tags as the post you are currently reading.

 global $post;
    $this_post_tags_ids = wp_get_post_tags( $post->ID, array( 'fields' => 'ids' ) );

    $query = new WP_Query( array('post_type' => 'post', 'posts_per_page' => -1, 'tag__in' => $this_post_tag_ids ) );
    if ($query->have_posts()){
       while($query->have_posts()){
          $query->the_post();
          echo the_title('<h3><a href="'.get_the_permalink.'"/>', '</a></h3>');
       }
    }

wp_reset_query();

I didn’t tested it, but it should work.