Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm trying to create a custom permalink structure. I'd like to have a custom page which displays each post's image attachments, using the following structure:

www.mysite.com/hello-world/images

If anyone visited this URL, it would serve up a page of images that are attached to hello-world. It's kind of like having a subpage I guess, but I'd want it for posts (not pages) and I'd want it to be automatic.

I have a template .php coded-up for this purpose; it will grab all attached images and display them. I'm just looking for a way that people can get to it via the above URL structure.

I'm not sure how to go about doing this ie. if there's an easy way in Wordpress, or if I need to look into Rewrite rules in my .htaccess. Any thoughts would be appreciated, thanks -

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

You could achieve that by adding a rewrite endpoint via add_rewrite_endpoint.

This post from a WordPress developer has a good explanation of how they work.

share|improve this answer
    
Ah - exactly what I was looking for! Thanks –  wes Oct 2 '12 at 19:35
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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