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.

When I click on post images it redirects in a page with a url like this: http://localhost/?attachment_id=897. Can I set the default image link like http://localhost/wp-content/uploads/2012/05/dice.jpg instead of http://localhost/?attachment_id=818? Also how to style the attachments page? Should I have a page like attachments.php?

share|improve this question
add comment

1 Answer 1

up vote 0 down vote accepted

Navigate to: Dashboard -> Settings -> Media

Check this box: Organize my uploads into month- and year-based folders.

Save changes.

then

Navigate to: Dashboard -> Settings -> Permalinks

Select "Post name" under "Common Settings"

Save changes.

As far as styling an attachment page, you can either open up your page template file, and add a conditional check for is_attachment() or you can make an attachment.php file in your template directory. Read more about the template hierarchy for attachment display.

http://codex.wordpress.org/Using_Image_and_File_Attachments

share|improve this answer
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.