I use a lightbox to display images from posts in a website that is updated by differents authors.
Or course, the lightbox only works if the author makes sure that he uses link to the image directly while uploading the file.
1/3 of the time, the author forgets and the lightbox shows the html of the attachment.php page.
Is there possible to have a function, placed into attachments.php, that would return the image instead of the html page ? It would be simple to find the image itself, but I guess this would requires to change headers somewhere so the webserver returns the 'image/jpg' header.
I would manage the details but I would need some help to start with.
Thank you.
image_default_link_type
tofile
, if that's suitable for you.