Digital Sovereignty for everyone

How it works

Photo pages

A photo page is the gallery’s own post with a photo endpoint added, for example /2011/02/02/photos-grounds/photo/367/, where 367 is the attachment ID. It runs on the post’s own query, so it has the post’s visibility: private and password-protected posts stay protected, and a password-protected post sends visitors to the post to enter the password first.

Which photos belong to which gallery is read from the post’s own blocks, in the order visitors see them, following synced patterns. Only images set to link to the media file or attachment page get a photo page. The list is cached in post meta and rebuilt when the post, or a synced pattern it uses, changes. If the same image is in two galleries on a post, the first gallery is used.

An ID that is not in a gallery on the post is not a photo page. WordPress’s own 404 handling then sends the visitor on to the post itself, so a photo later removed from a gallery still lands somewhere useful, and each post still has exactly one URL per photo.

Gallery links

When a core Gallery block renders, each linked image’s link is pointed at its photo page. This works on the rendered markup, so galleries saved in the current format and the pre-5.9 format are both handled. Images in galleries outside the post content, such as in a template part, keep their original links.

On the page

  • The post title, linking back to the post.
  • The photo at full size with its responsive sizes, and its caption.
  • Previous and Next links and the photo’s position, such as 3 of 24. There is no wrap-around at either end.
  • A View full size link straight to the image file.

Arrow keys and horizontal swipes follow the same Previous and Next links. Without JavaScript the links still work.

Speed

Each photo page is plain HTML that the page cache can serve. The next photo’s image is preloaded, and speculation rules prerender the next page and prefetch the previous one, so in Chromium browsers moving on is close to instant. Browsers that support cross-document view transitions cross-fade between photos, unless the visitor prefers reduced motion.

Search engines and sharing

  • Each photo page is its own canonical URL.
  • The page title is the photo’s caption, or its alt text, or its position, followed by the post title.
  • The page owns its sharing tags: the caption as the meta description, and Open Graph and Twitter card tags pointing at the photo. It tells LH SEO Meta Tags (1.28.0+) through the lh_seo_meta_tags_is_page_meta_owned_elsewhere filter, so the post’s own tags are not printed as well. When Jetpack prints Open Graph tags, its tags are changed instead.
  • ImageObject structured data names the photo, its size and the post it belongs to.
  • A photo with no caption and no alt text is marked noindex, follow, so bare photos do not become thin pages in search results. Robots directives go through core’s wp_robots filter, so there is one robots tag.

If you like this plugin please consider making a donation to further development

Install LHero.org

lhero.org

Open it straight from your home screen, full screen and quicker to load.

  1. Tap the Share button . If you cannot see it, tap ••• first.
  2. Scroll down and tap Add to Home Screen.
  3. Tap Add.
  1. Tap the browser menu â‹®.
  2. Tap Install app or Add to Home screen.
  1. In the menu bar, choose File, then Add to Dock.

Use your browser's menu to install this site or add it to your home screen.