I am looking for a way to edit the way Wordpress’ native gallery displays images when clicked on. Specifically, I need to move the title below the image.

A more detailed explanation:
I setup a gallery using the built-in gallery inside of vanilla wordpress 3.6. It displays correctly and when I click on an image, I am directed to that image's page. I need to know where can I edit this particular page? I need to move the title to the bottom as well as some other stuff.

  • 1
    attachment.php is the file that loads a "single" attachment. – GhostToast Aug 29 '13 at 20:37
  • @GhostToast I don't think that's what I'm looking for. When you click on an image from the gallery, it takes you to a page with only that one image on it. I need to edit that page – issaaccbb Aug 29 '13 at 20:49
  • There is a setting in the Gallery to link to the Media File or the Attachment Page. If you go straight to Media File, it is just the image. The Attachment Page is attachment.php – GhostToast Aug 29 '13 at 20:58
  • @GhostToast I found the attachment.php, it was in my current theme. Not sure how that works, but thanks for pointing me in the right direction. – issaaccbb Aug 30 '13 at 14:32

In a theme image.php is the template that displays a single image attachment. There are many similar templates for other attachment types. The Codex has more information about attachment display templates.

If you don't have an image.php template you can quickly make one by making a copy of single.php and renaming it. Then you can edit it to your liking.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.