Wordpress provides templates for displaying media attached to a post or page (attachment.php
and more). They're also displayed with nice permalinks, such as:
site.com/projects/a-project/an-attachment/
Where projects
is the slug for my custom post type project
. a-project
is the post name, and an-attachment
is the name of an attached image.
The functionality I'm asking for is a sub URL endpoint for listing all post attachments with a dedicated template file. It would be great with a permalink for a post's attachments, wouldn't it?
Such as:
site.com/projects/a-project/attachments/
or
site.com/projects/a-project/images/
Is it possible? If not with pretty permalinks, is it with some kind of query variable? Apart from showing a single attachment, I haven't ever seen another form of sub URL endpoint to a Wordpress post before.
Thanks in advance!
EDIT
Some interesting resources:
http://johnbeales.com/20090824/endpoints-a-little-secret-for-url-manipulation-in-wordpress/
http://wordpress.org/support/topic/custom-rewrite-approach-with-add_rewrite_endpoint
http://www.rlmseo.com/blog/passing-get-query-string-parameters-in-wordpress-url/