When viewing related posts/attachments the thumbnail displays the same featured image i.e. of the current post. This is because the attachment ID is itself the image and doesn't need an extra check to get the thumbnail image.
An additional check is needed to see if this an attachment and if so to avoid trying to pull a featured image.
When viewing related posts/attachments the thumbnail displays the same featured image i.e. of the current post. This is because the attachment ID is itself the image and doesn't need an extra check to get the thumbnail image.
An additional check is needed to see if this an attachment and if so to avoid trying to pull a featured image.