I want to have a post like a gallery, but each image has an analysis for it. That analysis is like a post itself, with headings, paragraphs and some even have galleries within. I can make the post a series of post, but I would like to preserve the navigation between images like a gallery (forward/backward buttons and/or black background).

So far, using the built-in gallery, it's like this:

Clicking on one particular image, the caption is only one line:

I imagine my preferred outcome would be Facebook album:

Note that the "caption" of each image would be long and need to has rich formats.

Is there a way to do that?

Also asked on Software Recommendations Stack Exchange: WordPress plugin to have a gallery, in which each image's caption is a whole post?

  • Normally this would be closed as offtopic as it's asking for a recommendation
    – Tom J Nowell
    Jan 31, 2020 at 18:21
  • This still sounds like a recommendation request for you?
    – Ooker
    Feb 1, 2020 at 2:33
  • Yes, you posted the same question on software recommendations
    – Tom J Nowell
    Feb 1, 2020 at 11:06
  • Yes. I have intentionally changed the question to actually make this version in WordPress SE more like building a plugin for myself. Seems like it isn't clear enough though
    – Ooker
    Feb 1, 2020 at 12:14

1 Answer 1


Uploaded images are already posts, a gallery is just a list of post IDs with some display options

In WordPress, when you upload an image it creates a post of type attachment, and these posts have URLs, templates, etc

If you just link the gallery items to their attachment page rather than the media file you'll see this page.

Then, you can add an attachment.php to your theme, or even drill down to image.php etc. It might even look like the FB album you wanted if you code it that way.

Since attachments are posts, they can have comments, post meta, etc, just put your analysis in the description rather than the caption.

  • oh, so the image description is actually the body of the image post, and can support HTML? Is there any guide on how to work with attachment.php or image.php? I see that I have to create them
    – Ooker
    Feb 1, 2020 at 2:32
  • Keep in mind that because of the templatehierarchy, WP will fall back to single.php then index.phpif those templates don't exist, those templates are just templates, there's nothing special you need to do unless you want to do something special
    – Tom J Nowell
    Feb 1, 2020 at 11:08
  • Also, refer to the official documentation developer.wordpress.org/themes/template-files-section/…
    – Tom J Nowell
    Feb 1, 2020 at 11:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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