I'm working on a site that is using a theme with an attachment.php file in the theme. However, when going to an image's attachment page (i.e. https://domain/john-doe/) it loads the direct image (i.e. https://domain/files/2020/03/john-doe.png).
What would cause this to occur? I thought WordPress would load the attachment URL and present the item as coded in attachment.php, not the media file itself.
I'm working on a site that is using a theme with an attachment.php file in the theme. However, when going to an image's attachment page (i.e. https://domain/john-doe/) it loads the direct image (i.e. https://domain/files/2020/03/john-doe.png).
What would cause this to occur? I thought WordPress would load the attachment URL and present the item as coded in attachment.php, not the media file itself.
Share Improve this question asked Mar 24, 2020 at 17:57 AnthonyAnthony 311 silver badge5 bronze badges 1- 1 It depends on your theme and plugins. If you're using a plugin like Yoast WP SEO, there are settings to disable attachment pages (because they're usually not good for SEO). Check your plugin settings and/or deactivate all plugins, see if you still have the problem, and reactivate one by one to find out which one is the issue. – WebElaine Commented Mar 24, 2020 at 20:20
1 Answer
Reset to default 0Thanks @WebElaine.
We're running Yoast SEO so I had another look and saw the setting in Search Appearance > Media (wp-admin/admin.php?page=wpseo_titles#top#media).