I have a problem I need to fix with the URLs that are generated for the attachment pages of images with metadata.
I’m working on a photography site where individual photos are displayed as attachments to a post, via attachment.php
.
The URL scheme for displaying these photos is something like this:
domain.com/project-name/attachment/attachment-name
.
If I upload an image without any metadata, then the last part of the attachment URL is taken from the file name of the image. So, if the image is ABCD.jpg
, then the URL is domain.com/project-name/attachment/ABCD
. All good.
However, if the image does have a title in the metadata, then the URL is set to that title: domain.com/project-name/attachment/omg-cool-photo
.
Is it possible to have a metadata title with a photo, but to also have the URL that is set for the attachment to remain as the photo filename? If so, how?
I took a look around but I couldn’t see anything about this here already. Sorry if it is and I missed it.
Any help gratefully received!
Thanks.