In WordPress, files uploaded to the media library or assigned to posts are considered attachments. The diagram shows templates going up to seven levels for attachments. However, we rarely use these templates unless the primary feature of the site is managing attachments. Therefore, the single.php template will be responsible for handling attachments in most themes. We are not going to discuss the optional templates due to their lack of use.
You can go to Media | Library and click on one of the attachments. Then, you can click the View Attachment Page link to view the attachment using the single.php file. If your site requires that you change the default template, you should add the attachment.php file to the child ...