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.

On one of my sites if a post's permalink is as follows:

http://example.com/side-view-of-sheikh-zayed-grand-mosque-in-abu-dhabi-united-arab-emirates/

the attachment page for the thumbnail image (i.e. featured image) will be like this:

http://example.com/side-view-of-sheikh-zayed-grand-mosque-in-abu-dhabi-united-arab-emirates/side-view-of-sheikh-zayed-grand-mosque-in-abu-dhabi-united-arab-emirates-2/

In other words, the attachment page URL is a repetition of the parent post's URL (sometimes with a '2' slapped on it at the end like in the example).

I want to make the attachment page URLs like this:

http://example.com/post-url/artwork-detail/

I also pass GET parameters to the attachment pages like this:

http://example.com/post-url/post-url?size=400

I want this to become:

http://example.com/post-url/artwork-detail/size-400

The URL duplication is my big concern, the GET translation isn't a priority so long as the parameters aren't lost.

share|improve this question
add comment

1 Answer

The attachment page generally gets the "title" value as it's slug. Are you not filling in the image information like title, caption, etc? Might give that a try.

share|improve this answer
    
Ah thank you! I realize that this is the issue. I have code that grabs the parent post's title and uses it as the image title (which is then used to rename the image file). In this case I will change my code to work on another image attribute to avoid this duplication. –  Hawramani Aug 26 '12 at 14:36
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.