Clear all

Attachment Page and Function  



I'm finding that even though the WP image handler and the Gutentor image blocks give the option of linking to an attachment page, it doesn't seem to be implemented in the theme. Is that correct?

I added a generic attachment.php to my child theme, and it made no difference. It seems like any attachment call is being routed to the plain image file.  I would love to be able to use attachment pages.

2 Answers

Hello John,

If there is not attachment.php template in the theme by default single.php template is used for the attachment page. If you've created attachment.php template on your child theme then it should use that template for the attachment page.

I've checked for it, and it works fine. Here's an example:



Yes, your example looks fine, but that's not how mine is working.

In the attachment, I'm inserting an image using the default WP block system. As you see it gives option of unique URL, media link, or attachment page link. I choose Attachment.

(Next comment will have 2nd screenshot)

This is in reference to this page:

Attachment removed

After updating page, mouseover the image and the URL looks a bit like your example, except I would expect[image-file-name], not[image-file-name]. But that doesn't seem to make any difference.

Clicking the image loads it as a full-screen media file, not as single template or attachment template.

Thank again for any help.

Attachment removed

Browse our handcrafted free & pro themes.

Get things done easily with our custom crafted services.

Fall in love with our friendly support team.