single.php being ignored, going straight to attachment.php

OK, well, I’ve put the search for a proper answer on hold and instead cobbled together a ‘for now’ solution. First, in the referring page that is linking to the individual Post page, I’ve added this:

$theid = $post->ID;
echo "<li><a href="";
the_permalink();
echo "?id=" . $theid;
echo "">";
echo "blah";
echo "</a>";

So, on line 1 of above code, I get the ID of the Post I’m linking to and on line 4, I’m adding that id to a query string so the link is then:

http://somedomain.co.uk/post-name/?id=whatever_the_id_is

And then in attachment.php I have:

1) For standard WP fields (the_content etc) the ID seems to get passed automatically and pulls out the right data.

2) For custom fields (I’m using Advanced Custom Fields plugin), the ID is not being passed automatically, so I have:

//pseudo code assuming cleaning and testing var exists etc
$pid = $_GET['id'];
$url = get_field('custom_field_here', $pid);

This then pulls the custom fields for the right Post.

I’m aware this is not a great solution but it’ll have to suffice until I can figure out why single.php is being ignored.